PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Sun Jul 14, 2024 7:19 pm

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Page empty ?
PostPosted: Fri Aug 31, 2012 1:36 pm 
Offline

Joined: Tue Aug 21, 2012 8:15 am
Posts: 3
Hello,

How can I know if a page is empty ?

Thank

Daniel


Top
 Profile  
Reply with quote  
 Post subject: Re: Page empty ?
PostPosted: Sun Sep 02, 2012 7:56 am 
Offline
PDFsharp Expert
User avatar

Joined: Wed Dec 09, 2009 8:59 am
Posts: 343
Hi!
LAMBLIN wrote:
How can I know if a page is empty?
PDFsharp was not designed to answer that question.

How do you define "empty"? You can use other tools to create a bitmap from that page - and if the bitmap is all white, then it surely looks empty to human eyes (even though it may contain white text on transparent background). Items drawn outside the page boundaries will also be ignored that way.
For example Ghostscript can be used to create bitmaps.

_________________
Öhmesh Volta ("() => true")
PDFsharp Team Holiday Substitute


Top
 Profile  
Reply with quote  
 Post subject: Re: Page empty ?
PostPosted: Mon Sep 03, 2012 8:21 am 
Offline

Joined: Tue Aug 21, 2012 8:15 am
Posts: 3
Hello,

For me an empty page means that nothing is draw on the page.
In fact I am looking for a solution to crop PDF file by command line on windows by remove blank around a subject.
The subject is a rectang area who contains all draw elements of the page. I dont know how to get the coordinates of this rectang. I don't know if it is possible on PDFSHARP.
So a solution I imagine is to make crop pages to test when the page become not empty (perhaps it is crazy ?)
Even if your answer means that there is no solution,
thank you.

Daniel


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: Bing [Bot] and 28 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Privacy Policy, Data Protection Declaration, Impressum
Powered by phpBB® Forum Software © phpBB Group