From a21c6cef8e5f98004b66cdbf319b9395c04c2bb8 Mon Sep 17 00:00:00 2001 From: Jay Bryant Date: Fri, 6 Apr 2007 23:20:19 +0000 Subject: [PATCH] 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 --- src/java/org/apache/fop/render/pdf/PDFRenderer.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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) { -- 2.39.5