User login

Donate

Donate for server costs [more]

Target:
$ 3000
Achieved:
$ 186.3
Fees:
$ 13.36
6.2 %
Donate
SourceForge.net Logo

How to determine if a PDF file is valid?

1 reply [Last post]
mnv
Offline
Joined: 08/28/2009

Hello,

 

I use PDFCreator to generate PDF file in a batch

My problem is that I don't know when PDFCreator has finished to generate the PDF file.

As I use this PDF file directly after PDFCreator, I sometimes read the file before it is completly generated.

 

Even if the PDFCreator job has disappeared from the spooler, the generation isn't really finished in some cases. I have made all the checks done in the samples scripts. I also check if the size of the file don't change in a period of time. But i still have some file that pass through theese tests.

 

So my question is : is there a way to check the validity of a PDF file?

 

Thanks!

mnv
Offline
Joined: 08/28/2009

I have finaly found a workaround.

I now test the last line of the PDF file: if this line is equal to '%%EOF', I consider that the file is OK.

My batch now make a loop and read each PDF file until the file ends with '%%EOF'.

© pdfforge.org :: Contact us :: Sitemap