]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
changes to support named destinations
authorJay Bryant <jbryant@apache.org>
Sun, 1 Apr 2007 14:50:58 +0000 (14:50 +0000)
committerJay Bryant <jbryant@apache.org>
Sun, 1 Apr 2007 14:50:58 +0000 (14:50 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@524607 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/fop/render/pdf/PDFRenderer.java

index 481ce844cf282df4c308f53adda6f31c0a8a7f45..e54df5c878393c69a9d5ae12889d332b178ab977 100644 (file)
@@ -73,6 +73,7 @@ import org.apache.fop.pdf.PDFAMode;
 import org.apache.fop.pdf.PDFAnnotList;
 import org.apache.fop.pdf.PDFColor;
 import org.apache.fop.pdf.PDFConformanceException;
+import org.apache.fop.pdf.PDFDestination;
 import org.apache.fop.pdf.PDFDocument;
 import org.apache.fop.pdf.PDFEncryptionManager;
 import org.apache.fop.pdf.PDFEncryptionParams;
@@ -105,6 +106,8 @@ import org.apache.xmlgraphics.xmp.Metadata;
 import org.apache.xmlgraphics.xmp.schemas.XMPBasicAdapter;
 import org.apache.xmlgraphics.xmp.schemas.XMPBasicSchema;
 
+import org.apache.fop.area.DestinationData;
+
 /**
  * Renderer that renders areas to PDF.
  */
@@ -509,8 +512,15 @@ public class PDFRenderer extends AbstractPathOrientedRenderer {
      * @see org.apache.fop.render.Renderer#processOffDocumentItem(OffDocumentItem)
      */
     public void processOffDocumentItem(OffDocumentItem odi) {
+        // render Destinations
+        if (odi instanceof DestinationData) {
+            PDFDestination destination = pdfDoc.getFactory().makeDestination((DestinationData) odi);
+            PageViewport pv = destination.getPageViewport();
+            String dest = (String)pageReferences.get(pv.getKey());
+            destination.setGoToReference(dest);
+        }
         // render Bookmark-Tree
-        if (odi instanceof BookmarkData) {
+        else if (odi instanceof BookmarkData) {
             renderBookmarkTree((BookmarkData) odi);
         } else if (odi instanceof OffDocumentExtensionAttachment) {
             ExtensionAttachment attachment = ((OffDocumentExtensionAttachment)odi).getAttachment();