From: Jay Bryant Date: Sun, 1 Apr 2007 14:50:58 +0000 (+0000) Subject: changes to support named destinations X-Git-Tag: fop-0_94~153 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=03bddb51cc6efd22965858351f429632dea24c52;p=xmlgraphics-fop.git changes to support named destinations git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@524607 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/java/org/apache/fop/render/pdf/PDFRenderer.java b/src/java/org/apache/fop/render/pdf/PDFRenderer.java index 481ce844c..e54df5c87 100644 --- a/src/java/org/apache/fop/render/pdf/PDFRenderer.java +++ b/src/java/org/apache/fop/render/pdf/PDFRenderer.java @@ -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();