From 4d61cb6adfe4609b8e9efc3a041059a0826355a6 Mon Sep 17 00:00:00 2001 From: Jeremias Maerki Date: Tue, 12 Aug 2008 15:41:03 +0000 Subject: [PATCH] Implemented named destinations for PDF painter. 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 | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/java/org/apache/fop/render/pdf/PDFPainter.java b/src/java/org/apache/fop/render/pdf/PDFPainter.java index 1456cb9fd..b13bed1e2 100644 --- a/src/java/org/apache/fop/render/pdf/PDFPainter.java +++ b/src/java/org/apache/fop/render/pdf/PDFPainter.java @@ -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()); -- 2.39.5