]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Implemented named destinations for PDF painter.
authorJeremias Maerki <jeremias@apache.org>
Tue, 12 Aug 2008 15:41:03 +0000 (15:41 +0000)
committerJeremias Maerki <jeremias@apache.org>
Tue, 12 Aug 2008 15:41:03 +0000 (15:41 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign@685192 13f79535-47bb-0310-9956-ffa450edef68

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

index 1456cb9fdc14b986eb705f3c5caaba2327ae4a28..b13bed1e21404d8e5e660894ebec2cb144a3f047 100644 (file)
@@ -63,6 +63,7 @@ import org.apache.fop.render.intermediate.extensions.AbstractAction;
 import org.apache.fop.render.intermediate.extensions.Bookmark;
 import org.apache.fop.render.intermediate.extensions.BookmarkTree;
 import org.apache.fop.render.intermediate.extensions.GoToXYAction;
+import org.apache.fop.render.intermediate.extensions.NamedDestination;
 import org.apache.fop.util.CharUtilities;
 
 /**
@@ -508,6 +509,12 @@ public class PDFPainter extends AbstractBinaryWritingIFPainter {
         }
     }
 
+    private void renderNamedDestination(NamedDestination destination) {
+        PDFAction action = getAction(destination.getAction());
+        pdfDoc.getFactory().makeDestination(
+                destination.getName(), action.makeReference());
+    }
+
     private PDFAction getAction(AbstractAction action) {
         if (action instanceof GoToXYAction) {
             GoToXYAction a = (GoToXYAction)action;
@@ -534,6 +541,8 @@ public class PDFPainter extends AbstractBinaryWritingIFPainter {
             pdfUtil.renderXMPMetadata(wrapper);
         } else if (extension instanceof BookmarkTree) {
             renderBookmarkTree((BookmarkTree)extension);
+        } else if (extension instanceof NamedDestination) {
+            renderNamedDestination((NamedDestination)extension);
         } else {
             log.warn("Don't know how to handle extension object: "
                     + extension + " (" + extension.getClass().getName());