]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Update: Links added to AnnotList
authorarved <arved@unknown>
Sun, 5 Mar 2000 02:53:53 +0000 (02:53 +0000)
committerarved <arved@unknown>
Sun, 5 Mar 2000 02:53:53 +0000 (02:53 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@193283 13f79535-47bb-0310-9956-ffa450edef68

src/org/apache/fop/render/pdf/PDFRenderer.java

index f8265f1b14fba09e1dda8629a8a0234b7cc37813..17926ffc867818f22a838f85169f4c132579dc2b 100644 (file)
@@ -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);
+
     }
 
     /**