The ability to have "rubbish" at the start or end of the PDF was one  
of the things that was done during the Adobe->ISO transition of PDF  
1.7 to ISO 32000 to tighten down the PDF file format for the future.

So while a file with such 'rubbish' is PDF 1.7 compliant, for example,  
it is NOT ISO 32000 compliant.  And as noted, Adobe Acrobat/Reader are  
able to properly consume the file.  HOWEVER, like iText, any such  
'rubbish' is tossed during processing.

Leonard

On Dec 13, 2008, at 1:04 PM, Michael Klink wrote:

>> "Some" rubbish is allowed at the end of the PDF file, but not too  
>> much.
>
> Actually no rubbish at all is allowed by the PDF standard itself.  
> According to specification (ISO 32000-1:2008 Abschnitt 7.5.5,  
> ähnlich in früheren PDF-Spezifikationen) the %%EOF-line has to be  
> the final one of the document:
>
> "The last line of the file shall contain only the end-of-file  
> marker, %%EOF."
>
>> From the top of my head, I'd say you may not have more than 1028  
>> bytes
>> of rubbish, BUT you should check that number AND different viewers  
>> will
>> have a different tolerance.
>
> Adobe Acrobat and Reader are a bit lax about these specification  
> parts. The Acrobat 9 implementation notes state:
>
> "Acrobat viewers require only that the %%EOF marker appear somewhere  
> within the last 1024 bytes of the file."
>
> Some people utilize this leniency to add some own data to PDF  
> documents.
>
> This does not imply, though, that this is in accordance to  
> specification. Strictly speaking, such PDF files are broken.
>
> Regards,   Michael.
>
> -----Ursprüngliche Nachricht-----
> Von: 1T3XT info [mailto:[email protected]]
> Gesendet: Samstag, 13. Dezember 2008 11:57
> An: Post all your questions about iText here
> Betreff: Re: [iText-questions] PJL commands in pdf files: OK?
>
> Carsten Hammer wrote:
>> Hi,
>> I recently got some pdf files that contain before and after the pdf
>> bytestream a few lines PJL "rubbish". Though I would say this is not
>> valid according to the pdf reference it seems to work in most cases.
>> Acrobat 8 does not seem to care. Some of these files get problems  
>> after
>> itext does some manipulations on them (on some printers, ghostscript
>> says xref rebuild). Are you aware of limitations of itext to work  
>> with
>> such "broken" pdf? Is it right that I call them "broken" or did  
>> just not
>> read  the pdf reference right and this is valid?
>> Best regards,
>> Carsten
>
> It's not OK for a PDF file NOT to start with %PDF. My guess is that  
> when
> tools say that the xref is rebuilt, the byte offsets of each PDF  
> object
> had to be changed to take the extra bytes into account (the Cross
> Reference table tells the viewer where to find every object in the PDF
> file).
>
> "Some" rubbish is allowed at the end of the PDF file, but not too  
> much.
> From the top of my head, I'd say you may not have more than 1028 bytes
> of rubbish, BUT you should check that number AND different viewers  
> will
> have a different tolerance.
>
> I'd need some test PDFs to find out what happens when iText  
> manipulates
> them.
>
> -- 
> Psssst! Schon vom neuen GMX MultiMessenger gehört? Der kann`s mit  
> allen: http://www.gmx.net/de/go/multimessenger
>
> ------------------------------------------------------------------------------
> SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas,  
> Nevada.
> The future of the web can't happen without you.  Join us at MIX09 to  
> help
> pave the way to the Next Web now. Learn more and register at
> http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
> _______________________________________________
> iText-questions mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/itext-questions
>
> Buy the iText book: http://www.1t3xt.com/docs/book.php
>


------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.1t3xt.com/docs/book.php

Reply via email to