From: Jay Bryant Date: Fri, 6 Apr 2007 23:20:19 +0000 (+0000) Subject: Added a PDFGoTo to the PDFDestination handler, so that Destinations properly jump... X-Git-Tag: fop-0_94~144 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=a21c6cef8e5f98004b66cdbf319b9395c04c2bb8;p=xmlgraphics-fop.git Added a PDFGoTo to the PDFDestination handler, so that Destinations properly jump to the page referenced by the PDFGoTo. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@526315 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 e54df5c87..f64fa75aa 100644 --- a/src/java/org/apache/fop/render/pdf/PDFRenderer.java +++ b/src/java/org/apache/fop/render/pdf/PDFRenderer.java @@ -517,7 +517,11 @@ public class PDFRenderer extends AbstractPathOrientedRenderer { PDFDestination destination = pdfDoc.getFactory().makeDestination((DestinationData) odi); PageViewport pv = destination.getPageViewport(); String dest = (String)pageReferences.get(pv.getKey()); - destination.setGoToReference(dest); + Rectangle2D bounds = pv.getViewArea(); + double h = bounds.getHeight(); + float yoffset = (float)h / 1000f; + String gtRef = pdfDoc.getFactory().getGoToReference(dest, yoffset); + destination.setGoToReference(gtRef); } // render Bookmark-Tree else if (odi instanceof BookmarkData) {