Hi,

I'm seeking a hint on how I can create a PdfDestination to pages that I already have completed. Unfortunately, I only know which parameters to use for the PdfDestination after all the pages have been created.

The only solution that I was able to find required an additional method on the PdfDestination class because the PdfIndirectReference class and the PdfWriter.getPageReference() method are package private.

public boolean addPage(PdfWriter writer, int page) {
return addPage(writer.getPageReference(page));
}

But perhaps I have overlooked a different or better way to save some kind of reference to the pages when I create the pages.

regards,
finn
Index: PdfDestination.java
===================================================================
RCS file: /cvsroot/itext/src/com/lowagie/text/pdf/PdfDestination.java,v
retrieving revision 1.22
diff -u -r1.22 PdfDestination.java
--- PdfDestination.java 20 Jun 2002 13:28:22 -0000      1.22
+++ PdfDestination.java 31 Jan 2003 10:39:31 -0000
@@ -218,4 +218,14 @@
         }
         return false;
     }
+
+/** Adds the page number of the destination page.
+ *
+ * @param writer the writer instance.
+ * @param page a page number.
+ * @return true if the page reference was added
+ */
+    public boolean addPage(PdfWriter writer, int page) {
+        return addPage(writer.getPageReference(page));
+    }
 }


Reply via email to