You are right. Your patch looks good and will go into the next version.
Best Regards,
Paulo Soares
> -----Original Message-----
> From: Finn Bock [SMTP:[EMAIL PROTECTED]
> Sent: Tuesday, March 25, 2003 12:24
> To: [EMAIL PROTECTED]
> Subject: [iText-questions] The page 2 was requested but the document
> has only 1 pages.
>
> Hi Paulo,
>
> I'm attempting to create a PdfOutline to a PdfDestination to a target
> page after I have generated all the pages in the document. But the
> default initialization of PdfOutline is causing some problems.
>
> The code sequence I use looks like this:
>
> PdfDestination dest = new PdfDestination(PdfDestination.FITBH, 300);
> PdfAction.gotoLocalPage(1, dest, writer);
> PdfOutline pdfOutline = new PdfOutline(root, dest, "label");
>
> and the problem occurs (AFAICT) in PdfOutline.initOutline():
>
> void initOutline(PdfOutline parent, String title, boolean open) {
> ...
> setDestinationPage(writer.getCurrentPage());
> }
>
> Since I'm creating the outlines after the last page is created, the call
> to writer.getCurrentPage() references a non-existing page.
>
> I have attached a test program and a patch to PdfOutline that avoid the
> default call to setDestinationPage() when a destination is supplied
> already. At least it works for me, but maybe there is a better way?
>
> regards,
> finn << File: pdfoutline.patch >> << File: tstoutline.java >>
-------------------------------------------------------
This SF.net email is sponsored by:
The Definitive IT and Networking Event. Be There!
NetWorld+Interop Las Vegas 2003 -- Register today!
http://ads.sourceforge.net/cgi-bin/redirect.pl?keyn0001en
_______________________________________________
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions