On 23/09/2011 21:55, Palladian1881 wrote: > I'm trying to analyze pdf objects using PdfReader in Java. Some of the files > I'm trying to use generate a "PDF header signature not found" error. Are > these PDFs repairable? Even if they aren't, is there still a way to loop > through the pdf's objects (to determine their type) even with this error?
Did you try opening the PDF in a PDF viewer such as Adobe Reader? Did you succeed? If not, you can't fix the PDF. If so, what are you doing with the PDF before you send it to PdfReader, maybe the file is corrupted somewhere in the process. I've seen this happen plenty of times: people claiming that "the PDF is OK" (and it is), but they hide the fact that they screw up the file before handing it over to PdfReader. Did you try opening the PDF in a text editor? Did it start with %PDF- ? If not: we're not talking about a PDF file, why would you think it can be "repaired". Do you see any PDF objects? If not, how would iText be able to loop through object that simply aren't there? Right now, your question can be interpreted as: "I'm trying to analyze any file (Word, RTF, plain text,...) using PdfReader; but PDF reader says they're not PDF files." What would you answer if somebody asked you such a question? Surely, you'd answer: "You shouldn't expect a PdfReader to be able to read Word, RTF, plain text,... files!" So if you want a better answer, please provide the alleged PDF files so that they can be examined. ------------------------------------------------------------------------------ All of the data generated in your IT infrastructure is seriously valuable. Why? It contains a definitive record of application performance, security threats, fraudulent activity, and more. Splunk takes this data and makes sense of it. IT sense. And common sense. http://p.sf.net/sfu/splunk-d2dcopy2 _______________________________________________ iText-questions mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/itext-questions iText(R) is a registered trademark of 1T3XT BVBA. Many questions posted to this list can (and will) be answered with a reference to the iText book: http://www.itextpdf.com/book/ Please check the keywords list before you ask for examples: http://itextpdf.com/themes/keywords.php
