]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
FOP-2411: PDF to PDF Link not working
authorSimon Steiner <ssteiner@apache.org>
Thu, 11 Sep 2014 15:05:00 +0000 (15:05 +0000)
committerSimon Steiner <ssteiner@apache.org>
Thu, 11 Sep 2014 15:05:00 +0000 (15:05 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1624312 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/fop/render/pdf/PDFDocumentHandler.java
src/java/org/apache/fop/render/pdf/PDFPainter.java
src/java/org/apache/fop/render/pdf/PDFRenderingContext.java

index 648cdce7aeb674abab3080ad1126bd3271d92639..fddbdff913d2c5e24190052df9b509eaa918d9e8 100644 (file)
@@ -38,6 +38,7 @@ import org.apache.fop.accessibility.StructureTreeEventHandler;
 import org.apache.fop.apps.MimeConstants;
 import org.apache.fop.fo.extensions.xmp.XMPMetadata;
 import org.apache.fop.pdf.PDFAnnotList;
+import org.apache.fop.pdf.PDFArray;
 import org.apache.fop.pdf.PDFDocument;
 import org.apache.fop.pdf.PDFPage;
 import org.apache.fop.pdf.PDFResources;
@@ -94,6 +95,8 @@ public class PDFDocumentHandler extends AbstractBinaryWritingIFDocumentHandler {
     private final PDFDocumentNavigationHandler documentNavigationHandler
             = new PDFDocumentNavigationHandler(this);
 
+    private Map<Integer, PDFArray> pageNumbers = new HashMap<Integer, PDFArray>();
+
     /**
      * Default constructor.
      */
@@ -352,4 +355,8 @@ public class PDFDocumentHandler extends AbstractBinaryWritingIFDocumentHandler {
         }
         return structureTreeBuilder;
     }
+
+    public Map<Integer, PDFArray> getPageNumbers() {
+        return pageNumbers;
+    }
 }
index f85328b8b55814ccb61543dc2a2cb81fed95e65e..d1f247eea9716cb220ec85dae3600d9780b9ab8f 100644 (file)
@@ -188,6 +188,7 @@ public class PDFPainter extends AbstractIFPainter<PDFDocumentHandler> {
         PDFRenderingContext pdfContext = new PDFRenderingContext(
                 getUserAgent(), generator, getDocumentHandler().getCurrentPage(), getFontInfo());
         pdfContext.setMarkedContentInfo(imageMCI);
+        pdfContext.setPageNumbers(getDocumentHandler().getPageNumbers());
         return pdfContext;
     }
 
index 80adfa5c88915c80415da8830bd1fc4904b8a7ef..429d9b936a2c9d1dc90e26df9eca8bc7cc0d3323 100644 (file)
 
 package org.apache.fop.render.pdf;
 
+import java.util.Map;
+
 import org.apache.xmlgraphics.util.MimeConstants;
 
 import org.apache.fop.apps.FOUserAgent;
 import org.apache.fop.fonts.FontInfo;
+import org.apache.fop.pdf.PDFArray;
 import org.apache.fop.pdf.PDFPage;
 import org.apache.fop.render.AbstractRenderingContext;
 import org.apache.fop.render.pdf.PDFLogicalStructureHandler.MarkedContentInfo;
@@ -36,6 +39,7 @@ public class PDFRenderingContext extends AbstractRenderingContext {
     private FontInfo fontInfo;
     private PDFPage page;
     private MarkedContentInfo mci;
+    private Map<Integer, PDFArray> pageNumbers;
 
     /**
      * Main constructor.
@@ -88,4 +92,12 @@ public class PDFRenderingContext extends AbstractRenderingContext {
     MarkedContentInfo getMarkedContentInfo() {
         return mci;
     }
+
+    public Map<Integer, PDFArray> getPageNumbers() {
+        return pageNumbers;
+    }
+
+    public void setPageNumbers(Map<Integer, PDFArray> pageNumbers) {
+        this.pageNumbers = pageNumbers;
+    }
 }