From 9013a8081ee2bf6baeaac5908a9ecd066768f289 Mon Sep 17 00:00:00 2001 From: arved Date: Sun, 5 Mar 2000 02:53:53 +0000 Subject: [PATCH] Update: Links added to AnnotList git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@193283 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/fop/render/pdf/PDFRenderer.java | 23 ++++++++++++++----- 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/src/org/apache/fop/render/pdf/PDFRenderer.java b/src/org/apache/fop/render/pdf/PDFRenderer.java index f8265f1b1..17926ffc8 100644 --- a/src/org/apache/fop/render/pdf/PDFRenderer.java +++ b/src/org/apache/fop/render/pdf/PDFRenderer.java @@ -81,6 +81,9 @@ public class PDFRenderer implements Renderer { /** the current stream to add PDF commands to */ PDFStream currentStream; + /** the current annotation list to add annotations to */ + PDFAnnotList currentAnnotList; + /** the current (internal) font name */ protected String currentFontName; @@ -458,11 +461,9 @@ public class PDFRenderer implements Renderer { currentStream.add("ET\n"); - this.pdfDoc.makePage(this.pdfResources, currentStream, - page.getWidth()/1000, - page.getHeight()/1000); - if (page.hasLinks()) { + currentAnnotList = this.pdfDoc.makeAnnotList(); + Enumeration e = page.getLinkSets().elements(); while (e.hasMoreElements()) { LinkSet linkSet = (LinkSet) e.nextElement(); @@ -470,10 +471,20 @@ public class PDFRenderer implements Renderer { Enumeration f = linkSet.getRects().elements(); while (f.hasMoreElements()) { Rectangle rect = (Rectangle) f.nextElement(); - this.pdfDoc.makeLink(rect, dest); + currentAnnotList.addLink( + this.pdfDoc.makeLink(rect, dest) + ); } } - } + } else { + currentAnnotList = null; + } + + this.pdfDoc.makePage(this.pdfResources, currentStream, + currentAnnotList, + page.getWidth()/1000, + page.getHeight()/1000); + } /** -- 2.39.5