Welcome! Log In Create A New Profile

Advanced

Application to delete blank pages in a pdf

Posted by Gautam.pcs.crosspost 
Gautam.pcs.crosspost
Application to delete blank pages in a pdf
May 11, 2009 02:07PM
Hi Everyone

I have several thousands of PDF files of scanned paper documents. Some of these pdf's have blank pages in between (as they were scanned in duplex mode).

I want to write a Windev application that will scan the pdf document and delete the blank pages.

Searching over the net I have found there are various software tools available to do this but I would like to develop an app using Windev.

Can anyone point me in the right direction?

I was thinking that I could convert the pdf to tiff and look at the images to detect if the pixels match a blank page and then record the page numbers that show up as blank and then print the entire pdf document again to a new pdf excluding the pages that were detected as blank.

These are just my thoughts but any help in the right direction would help me immensely

Thank you in advance.

Best regards

Gautam

Message forwarded from pcsoft.us.windev
Fabrice Harari.pcs.crosspost
Re: Application to delete blank pages in a pdf
May 11, 2009 04:23PM
Hi

You can load each page of a pdf independently in an image field
(..pagenumber, If my memory is good)... Then you can check for black
pixels and save it or not as an image...

You can then print all the images in a report as a pdf...

The code itself is qui simple to do all that

BUT, some pdf are unfortunately not correctly supported (we were not
able to find out the exact origin of the problem,which has been
transmitted to pcsoft). there was apost with an example about this on
this forum a few weeks ago...

So if your pdfs are not fo that type,it's easy enough, if they are, all
pages will be blank

And of course, testing each pixel of a pge is a slow proposition, in any
case...

Best regards

--
Fabrice Harari
International WinDev, WebDev and WinDev mobile Consulting

More information on [www.fabriceharari.com]


Gautam wrote:
> Hi Everyone
>
> I have several thousands of PDF files of scanned paper documents. Some of these pdf's have blank pages in between (as they were scanned in duplex mode).
>
> I want to write a Windev application that will scan the pdf document and delete the blank pages.
>
> Searching over the net I have found there are various software tools available to do this but I would like to develop an app using Windev.
>
> Can anyone point me in the right direction?
>
> I was thinking that I could convert the pdf to tiff and look at the images to detect if the pixels match a blank page and then record the page numbers that show up as blank and then print the entire pdf document again to a new pdf excluding the pages that were detected as blank.
>
> These are just my thoughts but any help in the right direction would help me immensely
>
> Thank you in advance.
>
> Best regards
>
> Gautam
>
Message forwarded from pcsoft.us.windev
KenKnight
Re: Application to delete blank pages in a pdf
May 12, 2009 01:15AM
Hi Guatam,

I agree with Fabrice about the built-in functions. You may want to checkout some third-party libaries. I'm not sure that this has the function you're looking for, but pdf-xchange has a viewer sdk in the form of an activex. Also vintasoft has a PDF sdk that has a method of IsBlank or something similar, however, I'm not sure if it will apply on an already created PDF and finally GDpicturePro library may have what you're looking for. Vintasoft will be the least expensive option if it works.

Cheers!
Ken
Gautam.pcs.crosspost
Re: Application to delete blank pages in a pdf
May 13, 2009 03:45PM
Thanks Fabrice

I will try out your idea!

Regards

Gautam

Message forwarded from pcsoft.us.windev
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: