HI
I am getting following error while generating PDF from HTML file
Can you PLZ help
Exception in thread "main" java.lang.RuntimeException: The page 3 was
requested but the document has only 2 pages.
at com.lowagie.text.pdf.PdfWriter.close(Unknown Source)
at com.lowagie.text.pdf.PdfDocument.close(Unknown Source)
at com.lowagie.text.Document.close(Unknown Source)
at PDFCreater.makeDOC(PDFCreater.java:136)
at PDFCreater.main(PDFCreater.java:33)
I am putting following code to generate TOC
public void onStartPage(PdfWriter writer, Document document) {
try {
PdfContentByte cb = writer.getDirectContent();
PdfDestination destination = new
PdfDestination(PdfDestination.FITH);
new PdfOutline(cb.getRootOutline(),destination, "KSNet
Section #" + (++pgCnt));
} catch (Exception e) {}
}
Thanks & regards,
Avadhut K.
Sr Software Engineer
DFSSL-III, MIDC, Mumbai
Contact: 022-67108832
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/