From 187fbd17ecfcf76b019b4057ee905ba995a61d6a Mon Sep 17 00:00:00 2001 From: Simon Steiner Date: Thu, 11 Sep 2014 15:05:00 +0000 Subject: FOP-2411: PDF to PDF Link not working 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 | 7 +++++++ src/java/org/apache/fop/render/pdf/PDFPainter.java | 1 + src/java/org/apache/fop/render/pdf/PDFRenderingContext.java | 12 ++++++++++++ 3 files changed, 20 insertions(+) diff --git a/src/java/org/apache/fop/render/pdf/PDFDocumentHandler.java b/src/java/org/apache/fop/render/pdf/PDFDocumentHandler.java index 648cdce7a..fddbdff91 100644 --- a/src/java/org/apache/fop/render/pdf/PDFDocumentHandler.java +++ b/src/java/org/apache/fop/render/pdf/PDFDocumentHandler.java @@ -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 pageNumbers = new HashMap(); + /** * Default constructor. */ @@ -352,4 +355,8 @@ public class PDFDocumentHandler extends AbstractBinaryWritingIFDocumentHandler { } return structureTreeBuilder; } + + public Map getPageNumbers() { + return pageNumbers; + } } diff --git a/src/java/org/apache/fop/render/pdf/PDFPainter.java b/src/java/org/apache/fop/render/pdf/PDFPainter.java index f85328b8b..d1f247eea 100644 --- a/src/java/org/apache/fop/render/pdf/PDFPainter.java +++ b/src/java/org/apache/fop/render/pdf/PDFPainter.java @@ -188,6 +188,7 @@ public class PDFPainter extends AbstractIFPainter { PDFRenderingContext pdfContext = new PDFRenderingContext( getUserAgent(), generator, getDocumentHandler().getCurrentPage(), getFontInfo()); pdfContext.setMarkedContentInfo(imageMCI); + pdfContext.setPageNumbers(getDocumentHandler().getPageNumbers()); return pdfContext; } diff --git a/src/java/org/apache/fop/render/pdf/PDFRenderingContext.java b/src/java/org/apache/fop/render/pdf/PDFRenderingContext.java index 80adfa5c8..429d9b936 100644 --- a/src/java/org/apache/fop/render/pdf/PDFRenderingContext.java +++ b/src/java/org/apache/fop/render/pdf/PDFRenderingContext.java @@ -19,10 +19,13 @@ 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 pageNumbers; /** * Main constructor. @@ -88,4 +92,12 @@ public class PDFRenderingContext extends AbstractRenderingContext { MarkedContentInfo getMarkedContentInfo() { return mci; } + + public Map getPageNumbers() { + return pageNumbers; + } + + public void setPageNumbers(Map pageNumbers) { + this.pageNumbers = pageNumbers; + } } -- cgit v1.2.3