Dhulipd,

Dhulipd2984 wrote
> We are using iText jars itextpdf and itextpdfa jars with version 5.5.1 to
> generate tagged PDF , facing below exception in unix environmnet but it is 
> working fine in windows.
> 
> java.lang.RuntimeException: The page 2 was requested but the document has
> only 1 pages.
>         at com.itextpdf.text.pdf.PdfWriter.close(PdfWriter.java:1248)
>         ...

This happens if a document with only one page is closed but contains a
reference (e.g. a bookmark) to a second page.

This situation can be caused e.g. if there is a document.newPage() call
initiating a new page, then some bookmark is established, and then the
document is closed. As the new page has no content at all, it is discarded.

Whenever you create a bookmark at the current location, please make sure
that the current page is not a final empty page to be eventually dropped.

Regards,   Michael



--
View this message in context: 
http://itext-general.2136553.n4.nabble.com/PdfDocument-close-doesn-t-work-in-unix-tp4660427p4660429.html
Sent from the iText - General mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a reference 
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples: 
http://itextpdf.com/themes/keywords.php

Reply via email to