Tony Stevens wrote: > The PDF reference (available on the Adobe website) is the best way to answer > questions like this. > > Section 3.4.1 File Header says that a valid PDF will always start with a > line like "%PDF−1.5" (obviously the exact version may be different). Of > course, this won't tell you if the content is valid, but should be enough to > indicate that it's supposed to be a PDF.
A validity checker has to look at different things: - file structure [1]: - is the XRef table OK - check the Carrousel Object System - ... - content stream [2]: - syntax of the Adobe Image System - resources present? - ... iText doesn't check [2], but PdfReader has some checks regarding [1] and if possible iText "repairs" the file (look for the isRebuilt() method). But if you want a full validity check, you need other software. -- This answer is provided by 1T3XT BVBA ------------------------------------------------------------------------- Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php _______________________________________________ iText-questions mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/itext-questions Do you like iText? Buy the iText book: http://www.1t3xt.com/docs/book.php Or leave a tip: https://tipit.to/itexttipjar
