PDFsharp & MigraDoc Foundation
https://forum.pdfsharp.net/

Page empty ?
https://forum.pdfsharp.net/viewtopic.php?f=2&t=2126
Page 1 of 1

Author:  LAMBLIN [ Fri Aug 31, 2012 1:36 pm ]
Post subject:  Page empty ?

Hello,

How can I know if a page is empty ?

Thank

Daniel

Author:  () => true [ Sun Sep 02, 2012 7:56 am ]
Post subject:  Re: Page empty ?

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.

Author:  LAMBLIN [ Mon Sep 03, 2012 8:21 am ]
Post subject:  Re: Page empty ?

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

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/