aboutsummaryrefslogtreecommitdiffstats
path: root/src/org/apache/fop/render
diff options
context:
space:
mode:
authorarved <arved@unknown>2000-03-05 02:53:53 +0000
committerarved <arved@unknown>2000-03-05 02:53:53 +0000
commit9013a8081ee2bf6baeaac5908a9ecd066768f289 (patch)
treeecd1c19395f122e9e363965c1d3d195383395ef9 /src/org/apache/fop/render
parent3532eea3c0a2a9dcd01c29bd5e22f86a3cabb07e (diff)
downloadxmlgraphics-fop-9013a8081ee2bf6baeaac5908a9ecd066768f289.tar.gz
xmlgraphics-fop-9013a8081ee2bf6baeaac5908a9ecd066768f289.zip
Update: Links added to AnnotList
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@193283 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/org/apache/fop/render')
-rw-r--r--src/org/apache/fop/render/pdf/PDFRenderer.java23
1 files 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);
+
}
/**