Hi, >(Actually, someone has changed this code to check for <1.3 instead of <1.5. >Don't know the reason for this?) This helps me out as my pdfs have version 1.3, probably some other people had the same problem...
I've done some further investigation concerning the Pdf version when saving the pdfs with Acrobat to update the version. Acrobat moves the file trailer to the Xref stream dictionary and updates the pdf version from 1.2 to 1.5 but only in the root entry of the file trailer and not at the beginning of the file, there it changes to 1.3, that's weird! Acrobat shows the correct version 1.5 in the properties, but Foxit for example shows 1.3 like PoDoFo. In section 7.5.2 of the pdf spec you find the following: ... "Beginning with PDF 1.4, the Version entry in the document's catalog dictionary (located via the Root entry in the file's trailer, as described in 7.5.5, "File Trailer"), if present, shall be used instead of the version specified in the Header." ... Acrobat should update both entries to the same version or at least the version info at the beginning of the file should remain at the old version. I checked how PoDoFo determines the Pdf version ( PdfParser::IsPdfFile() ), it uses the pdf version from the beginning of the file however beginning with Pdf 1.4 it should use the version from the file trailer in the Xref stream dictionary when existing instead of the entry at the beginning of the file. What about the situation when the pdf versions differs like in my case, does PoDoFo should always use the bigger version or always the version from Xref dictionary even if the version is smaller? Is it planned to determine the pdf version from the Xref dictionary? Best Regards Sebastian -----Ursprüngliche Nachricht----- Von: A. Massad [mailto:[email protected]] Gesendet: Mittwoch, 20. Januar 2010 17:35 An: EXTERNAL Loch Sebastian (Firma Ferchau; BhP/TEF17) Betreff: Re: [Podofo-users] Podofo Error 11 No trailer Hi Sebastian, Maybe you should have a look at the header of your converted PDFs: What's the PDF version there? There is a version check in PdfParser::ReadTrailer() which requires at least PDF 1.5 for trailers in crossref streams. (Actually, someone has changed this code to check for <1.3 instead of <1.5. Don't know the reason for this?) Therefore, you could try to edit the headers of your PDFS (with a text editor, e.g. vi) to show PDF version 1.5 and try to read in the file with podofo again. Still, I am not aware that Acrobat yields files with wrong versions in the header. This is something I have seen produced by Pitstop - it has a setting which prevents updates of the PDF version when saving newer files. Best regards, Amin Am 20.01.2010 um 10:58 schrieb EXTERNAL Loch Sebastian (Firma Ferchau; BhP/TEF17): > Hello all, > > we have here some pdfs where PoDoFo complains about a missing trailer. > > First of all I thought we have invalid pdfs, but I checked the actual Pdf > spec at http://www.adobe.com/devnet/acrobat/pdfs/PDF32000_2008.pdf and I > found the following in > section 7.5.8.1: > > "The value following the startxref keyword shall be the offset of the > cross-reference stream > rather than the xrefkeyword. For files that use cross-reference streams > entirely (that is, > files that are not hybrid-reference files; see 7.5.8.4, "Compatibility with > Applications That > Do Not Support Compressed Reference Streams"), the keywords xref and trailer > shall no longer > be used. Therefore, with the exception of the startxref address %%EOFsegment > and comments, a > file may be entirely a sequence of objects." > > This tells that the trailer as a stand-alone dictionary in the finishing > section of the document > is not required anymore if you use a pure XRef stream style PDF. The trailer > data in this case are > put into the Xref stream dictionary. So there are indeed cases where a PDF > legitimately does not > have a trailer. Correct? > > I checked our pdf and found the information in this dictionary. > > Any ideas to get PoDoFo working with those types of Pdf? > Does PoDoFo support this already? > > Best Regards > Sebastian > > PS: Some of these pdfs contained a file trailer "old" style produced with an > old version of Adobe Acrobat > in Pdf 1.2. We needed these documents in an actual Pdf version, therefore we > saved it with the actual > Adobe Acrobat 9.2.0 and the trailer "old" style containing a trailer keyword > followed by a trailer dictionary > disappeared! Acrobat shouldn't do this automatically... ------------------------------------------------------------------------------ Throughout its 18-year history, RSA Conference consistently attracts the world's best and brightest in the field, creating opportunities for Conference attendees to learn about information security's most important issues through interactions with peers, luminaries and emerging and established companies. http://p.sf.net/sfu/rsaconf-dev2dev _______________________________________________ Podofo-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/podofo-users
