Yes, that is right -- the original file did not have a trailer.

This arises when I am creating a combined PDF from several files.  At 
the point when I instantiate a PdfReader for the original file, I get 
the IOException, with the "missing trailer" message.

I have contact information from the organization which supplied the 
originals, and am going to see what I can find out regarding how the pdf 
was produced, and see if they can produce a "hello world" example in the 
same way.

Leonard Rosenthol wrote:
> OH – the original file didn’t have a trailer either???
> 
> Leonard
> 
> 
> On 6/11/09 3:28 PM, "Paul Gatewood" <[email protected]> wrote:
> 
>     Hi Leonard,
> 
>     Thanks for the very speedy feedback.
> 
>     I am using Adobe Acrobat 9 Pro, Version 9.1.1 on Windows XP.
> 
>     I am going to repeat my steps here, just to be sure.
>     1) Start Acrobat
>     2) Open original file (without trailer) (sorry I can not supply this --
>     it has confidential information from a 3rd party)
>     3) Choose TouchUp Object tool (this PDF only has 2 images)
>     4) Right click each of the 2 images, and choose "delete"
>     5) Choose File -> Save As
>     6) Enter "leonard.pdf" for the file name (Save as type: Adobe PDF File)\
>     7) Exit
> 
>     The file I just produced is attached.
> 
>     Thanks,
>     -Paul
> 
>     Yes, I produced the file as follows:
> 
>     Leonard Rosenthol wrote:
>     >  Yes – without the trailer you can’t find anything else in the PDF.
>     >
>     >  I find it VERY hard to believe that you saved that file from Adobe
>     >  Acrobat 9.x – it would have a trailer.  Please provide the file
>     that you
>     >  opened originally in Acrobat 9 and then any information about the
>     saving
>     >  process. Did you just do File->Save?  Save As?  Other?  Is this 9.0,
>     >  9.1, 9.1.1 or 9.1.2?  On what OS platform?
>     >
>     >  Leonard
>     >
>     >
>     >  On 6/11/09 2:19 PM, "Paul Gatewood" <[email protected]> wrote:
>     >
>     >      Is the trailer element always required in a PDF document?
>     >
>     >      I have recently encountered documents without the trailer
>     (IOException
>     >      "trailer not found" when instantiating PdfReader).
>     >
>     >      In the past, the "save as" feature of Acrobat produced a PDF
>     with the
>     >      trailer.
>     >
>     >      Now I am using Acrobat 9 and the "save as" does not add the
>     trailer (at
>     >      least to the files I am encountering at the moment).
>     >
>     >      Looking at the PDF specification at
>     >      http://www.adobe.com/devnet/acrobat/pdfs/PDF32000_2008.pdf (I
>     hope this
>     >      is the right location), I see at the end of section 7.5.8.1 the
>     >      following:
>     >
>     >           "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."
>     >
>     >      I am in no way a PDF expert, so I don't know whether this is
>     apropos to
>     >      this situation or not, but I am trying to do homework before
>     asking for
>     >      help :-)
>     >
>     >      I can not supply the PDF I received, due to its confidential
>     content.
>     >      I have, however, edited it with Acrobat 9 to remove all the
>     content I
>     >      could see, then saved it ("save as") to a file called
>     >      test-saved-from-acrobat-9.pdf, which I am attaching.
>     >
>     >      So, does anyone know more about this, i.e. whether in this
>     situation it
>     >      really is legitimate that the trailer is omitted?
>     >
>     >      And if so, is there a way to deal with this in iText?  I am
>     currently
>     >      using iText 2.1.4.
>     >
>     >
>     >  --
>     >  Leonard Rosenthol
>     >  PDF Standards Architect
>     >  Adobe Systems Incorporated
>     >
>     >
>     >
>     ------------------------------------------------------------------------
>     >
>     >
>     
> ------------------------------------------------------------------------------
>     >  Crystal Reports - New Free Runtime and 30 Day Trial
>     >  Check out the new simplified licensing option that enables unlimited
>     >  royalty-free distribution of the report engine for externally facing
>     >  server and web deployment.
>     >  http://p.sf.net/sfu/businessobjects
>     >
>     >
>     >
>     ------------------------------------------------------------------------
>     >
>     >  _______________________________________________
>     >  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
>     >  Check the site with examples before you ask questions:
>     http://www.1t3xt.info/examples/
>     >  You can also search the keywords list:
>     http://1t3xt.info/tutorials/keywords/
> 
> 
> -- 
> Leonard Rosenthol
> PDF Standards Architect
> Adobe Systems Incorporated
> 
> 
> ------------------------------------------------------------------------
> 
> ------------------------------------------------------------------------------
> Crystal Reports - New Free Runtime and 30 Day Trial
> Check out the new simplified licensing option that enables unlimited
> royalty-free distribution of the report engine for externally facing 
> server and web deployment.
> http://p.sf.net/sfu/businessobjects
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> 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
> Check the site with examples before you ask questions: 
> http://www.1t3xt.info/examples/
> You can also search the keywords list: http://1t3xt.info/tutorials/keywords/


------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
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
Check the site with examples before you ask questions: 
http://www.1t3xt.info/examples/
You can also search the keywords list: http://1t3xt.info/tutorials/keywords/

Reply via email to