views:

163

answers:

1

Hi, im generating pdf files using a ruby library called "prawn". I have one particular file that seems to be considered "Corrupt" by adobe reader. It shows up fine in both preview and in adobe reader. It gives errors like:

Sometimes I get: "Could not find the XObject named '%s'.

Othertimes I get: "Could not find the XObject named "Im4".

Then always I get: "An error exists on this page. Acrobat may not display the page correctly. Please contact the person who created the PDF document to correct the problem."

Is there a way to open a pdf with some tool and have it tell you what is technically wrong with the pdf? Im sure I could figure it out quickly with something like this...

thanks Joel

+1  A: 

A PDF is a dump of PDF objects so it sounds like objects are missing or the references pointing to the object are wrong. You can view a PDF in a text editor and see the refs table and you can see the PDF objects in Acrobat (I wrote a blog article on this at (http://pdf.jpedal.org/java-pdf-blog/bid/10479/Viewing-PDF-objects).

Your best bet might to take an Open Source tool like IText which can read PDFs and add some debugging code to get it to show the object structures.

mark stephens
I think this might be what im looking for, I found a couple other "pdf analyzers" but most were for windoze. Ill give this one a try, thanks!
Joelio