aboutsummaryrefslogtreecommitdiffstats
path: root/src/org/apache/fop/render
diff options
context:
space:
mode:
authorarved <arved@unknown>2000-03-10 03:25:46 +0000
committerarved <arved@unknown>2000-03-10 03:25:46 +0000
commitc649688eac0265c45ca0a0fd7ad5d90ee4311eac (patch)
treef794f1b576841331355da071311ca55ecdb6233b /src/org/apache/fop/render
parentffa408791df4f6032a287f754cced20c677836bc (diff)
downloadxmlgraphics-fop-c649688eac0265c45ca0a0fd7ad5d90ee4311eac.tar.gz
xmlgraphics-fop-c649688eac0265c45ca0a0fd7ad5d90ee4311eac.zip
Added support for links
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@193296 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/org/apache/fop/render')
-rw-r--r--src/org/apache/fop/render/pdf/PDFRenderer.java21
1 files changed, 17 insertions, 4 deletions
diff --git a/src/org/apache/fop/render/pdf/PDFRenderer.java b/src/org/apache/fop/render/pdf/PDFRenderer.java
index a2af3330f..b97b7d776 100644
--- a/src/org/apache/fop/render/pdf/PDFRenderer.java
+++ b/src/org/apache/fop/render/pdf/PDFRenderer.java
@@ -82,6 +82,12 @@ 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 page to add annotations to */
+ PDFPage currentPage;
+
/** the current (internal) font name */
protected String currentFontName;
@@ -505,11 +511,15 @@ public class PDFRenderer implements Renderer {
currentStream.add("ET\n");
- this.pdfDoc.makePage(this.pdfResources, currentStream,
+ currentPage = this.pdfDoc.makePage(this.pdfResources, currentStream,
page.getWidth()/1000,
page.getHeight()/1000);
- /*if (page.hasLinks()) {
+ if (page.hasLinks()) {
+
+ currentAnnotList = this.pdfDoc.makeAnnotList();
+ currentPage.setAnnotList(currentAnnotList);
+
Enumeration e = page.getLinkSets().elements();
while (e.hasMoreElements()) {
LinkSet linkSet = (LinkSet) e.nextElement();
@@ -517,10 +527,13 @@ 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 {
+ // just to be on the safe side
+ currentAnnotList = null;
+ }
}
/**