PDFdev is a service provided by PDFzone.com | http://www.pdfzone.com _____________________________________________________________
From: "Campbell, Christopher" <[EMAIL PROTECTED]>
We use a third-party component called PDFLib to create PDF's programmatically. It has a PDF import feature that allows us to import multiple PDF files and merge them into one output document. I am trying to use it to import a particular set of PDF's that were generated by another utility (iConvert) and I am getting a "PDF Format Error" at offset 0x00000000. The PDF in question can be opened with Acrobat no problem. The PDF import feature has always worked with no problem for us on other PDF's. Does anyone know of a syntax checking utility for PDF? Is there a way I can find out what exactly is causing the error?
Meanwhile we got a sample file and here's the result (may be useful to know for other users of this application "iConvert": the PDF indeed triggers the "repair" message in Acrobat, and is rejected by our PDFlib+PDI product. This is caused by the required "%%EOF" line missing from the end of the file. Since we have never seen any PDF generator make such a trivial mistake we didn't relax our code to also work when this entry is missing (but we'll do so in the future). Since the offset entries in the xref table are correct you can easily fix the file by adding the required last line. There are many better ways to do this, but here's a little hack which you can do in a DOS shell without any additional tools:
- Create a text file containing "%%EOF" (without the quotes) and call it eof.txt.
- Locate the original PDF (say: bad.pdf) and issue the following command in the DOS shell:
copy /b bad.pdf+eof.txt good.pdf
The resulting PDF good.pdf will be opened by Acrobat without any "repair" message, and will be accepted by PDFlib+PDI just fine. As I said, we will amend our code so that it will accept this kind of non-conforming PDF in the future.
Depending on your relationship to the developers of "iConvert" it may be helpful to pass the above information to them.
Thomas
_______________________________________________________________ Thomas Merz [EMAIL PROTECTED] http://www.pdflib.com Personalize PDF: PDFlib Personalization Server and Block plugin _______PDFlib - a library for generating PDF on the fly________
To change your subscription: http://www.pdfzone.com/discussions/lists-pdfdev.html
