• Post Reply Bookmark Topic Watch Topic
  • New Topic

Need help on resolving java.io.IOException: trailer not found.

 
Ramasamy Anbalagan
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello guys,

I have been receiving below error while reading pdf document using iText api.

Error:
------
java.io.IOException: trailer not found.
at com.lowagie.text.pdf.PdfReader.rebuildXref(Unknown Source)
at com.lowagie.text.pdf.PdfReader.readPdf(Unknown Source)
at com.lowagie.text.pdf.PdfReader.<init>(Unknown Source)
at com.lowagie.text.pdf.PdfReader.<init>(Unknown Source)
at com.emc.documentum.pss.common.pdfapi.itext.PssESignGeneratorItext.addESignPages(PssESignGeneratorItext.java:731)

Code line:
----------

FileInputStream fileInputStream = new FileInputStream(signPdfName);
srcPDFReader = new PdfReader(fileInputStream); <Exception throwing on this line>.

Can any one help on this, how to resolve this issue.

It has been working for some pdf files and not working for some files.

 
Deepak Rao
Ranch Hand
Posts: 36
Eclipse IDE Firefox Browser
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ramasamy,

This seems like a format problem of the pdf. Were the pdf's too created using iText?
 
Ramasamy Anbalagan
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey Deepak,

Thanks for quick turn around on this.

I believe the document was not created by iText. It was published through some tool i think.

I have investigated something on this issue like "trailer" would be part of the PDF Spec which would be added to the document @ the time of creation. Suspecting document not created properly...I am not sure on this.
Do you have any idea how we can see the “trailer” on PDF Spec.

Thanks.Anbalagan
 
Deepak Rao
Ranch Hand
Posts: 36
Eclipse IDE Firefox Browser
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I feel the problem is in the files as some files are opening and some not.
Just curious to know if these files open in acrobat?

You can also try opening the pdf file in a textpad/notepad and search for "trailer".It will be there before the eof.

It will look like this

============
trailer
<<
/Size 46
/Root 1 0 R
/Info 45 0 R
>>
startxref
74012
%%EOF
==============
You can then compare them against the files which work.

Thanks
Deepak
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!