diff options
author | Jeremias Maerki <jeremias@apache.org> | 2005-06-30 07:56:25 +0000 |
---|---|---|
committer | Jeremias Maerki <jeremias@apache.org> | 2005-06-30 07:56:25 +0000 |
commit | 7cda5ead41cc5605ce48551a8fcd515711050939 (patch) | |
tree | 4a31c8e50a9f66e4c552b899bd6c10d63fd3eaa5 /src/java/org/apache | |
parent | 86598c0a956660dc9f07ea4650de9834df43bb96 (diff) | |
download | xmlgraphics-fop-7cda5ead41cc5605ce48551a8fcd515711050939.tar.gz xmlgraphics-fop-7cda5ead41cc5605ce48551a8fcd515711050939.zip |
Fix placement of links in PDFs.
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@202503 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache')
-rw-r--r-- | src/java/org/apache/fop/render/pdf/PDFRenderer.java | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/java/org/apache/fop/render/pdf/PDFRenderer.java b/src/java/org/apache/fop/render/pdf/PDFRenderer.java index 0d5af5877..5af6df8d8 100644 --- a/src/java/org/apache/fop/render/pdf/PDFRenderer.java +++ b/src/java/org/apache/fop/render/pdf/PDFRenderer.java @@ -158,6 +158,8 @@ public class PDFRenderer extends PrintRenderer { * the current page to add annotations to */ protected PDFPage currentPage; + + protected AffineTransform currentBasicTransform; /** drawing state */ protected PDFState currentState = null; @@ -463,6 +465,8 @@ public class PDFRenderer extends PrintRenderer { // Transform origin at top left to origin at bottom left currentStream.add("1 0 0 -1 0 " + (int) Math.round(pageHeight / 1000) + " cm\n"); + currentBasicTransform = new AffineTransform(1, 0, 0, -1, 0, + (int) Math.round(pageHeight / 1000)); currentFontName = ""; @@ -1290,7 +1294,8 @@ public class PDFRenderer extends PrintRenderer { Rectangle2D rect = new Rectangle2D.Float(start, top, width, height); // transform rect to absolute coords AffineTransform transform = currentState.getTransform(); - rect = transform.createTransformedShape(rect).getBounds(); + rect = transform.createTransformedShape(rect).getBounds2D(); + rect = currentBasicTransform.createTransformedShape(rect).getBounds2D(); int type = internal ? PDFLink.INTERNAL : PDFLink.EXTERNAL; PDFLink pdflink = pdfDoc.getFactory().makeLink( |