Archana Nagesh wrote:
> Hi,
> 
> I am generating a PDF using iText.
> In most cases the PDF generation is successful. But sometimes I get the 
> following error (this error is a random one):
> 
> Rebuild failed: trailer not found; Original message: PDF startxref not found

Are these PDFs generated with iText?

If not, then you have PDFs that aren't complete (1).
These PDFs are invalid and can't be rebuilt.
Or (2) the PDFs are complete, but plenty of rubbish
is added at the end (gibberish, stuff that prevents
the viewer to find the %EOF).

If they are iText generated, (1) could happen when you
forget to close() the document (or when the process
generating the PDF closes the stream before document.close()
is reached). In chapter 17 of my book, I have an anecdote
from my day job where somebody created a PDF and added some
HTML to the stream after the PDF was generated, causing
problem (2) as described above. Fortunately, I didn't have
to tell me colleague he had made a stupid mistake. He said
so himself ;-)

br,
Bruno

-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
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

Reply via email to