]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Added a PDFGoTo to the PDFDestination handler, so that Destinations properly jump...
authorJay Bryant <jbryant@apache.org>
Fri, 6 Apr 2007 23:20:19 +0000 (23:20 +0000)
committerJay Bryant <jbryant@apache.org>
Fri, 6 Apr 2007 23:20:19 +0000 (23:20 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@526315 13f79535-47bb-0310-9956-ffa450edef68

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

index e54df5c878393c69a9d5ae12889d332b178ab977..f64fa75aabc4683961ec9e6ddd08b4f69b31f1e3 100644 (file)
@@ -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) {