aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeremias Maerki <jeremias@apache.org>2008-04-04 12:19:50 +0000
committerJeremias Maerki <jeremias@apache.org>2008-04-04 12:19:50 +0000
commit3465436b86cf3153adfd9e275f9da72c6847086c (patch)
treeaebb470efaa93f952247a13676cd06d56839c03f
parent9bccefa52425d4ce58d9230e60c2ea2ee11540d7 (diff)
downloadxmlgraphics-fop-3465436b86cf3153adfd9e275f9da72c6847086c.tar.gz
xmlgraphics-fop-3465436b86cf3153adfd9e275f9da72c6847086c.zip
Bugzilla #44743:
Added a public accessor for reference to the current page to PDFGraphics2D. Submitted by: Yegor Kozlov <yegor.at.dinom.ru> git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@644691 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--src/java/org/apache/fop/svg/PDFGraphics2D.java14
-rw-r--r--status.xml3
2 files changed, 14 insertions, 3 deletions
diff --git a/src/java/org/apache/fop/svg/PDFGraphics2D.java b/src/java/org/apache/fop/svg/PDFGraphics2D.java
index f6a7cbc3b..1e23a6f20 100644
--- a/src/java/org/apache/fop/svg/PDFGraphics2D.java
+++ b/src/java/org/apache/fop/svg/PDFGraphics2D.java
@@ -304,7 +304,15 @@ public class PDFGraphics2D extends AbstractGraphics2D {
}
/**
- * Set the Grpahics context.
+ * Gets the PDF reference of the current page.
+ * @return the PDF reference of the current page
+ */
+ public String getPageReference() {
+ return this.pageRef;
+ }
+
+ /**
+ * Set the Graphics context.
* @param c the graphics context to use
*/
public void setGraphicContext(GraphicContext c) {
@@ -390,7 +398,7 @@ public class PDFGraphics2D extends AbstractGraphics2D {
if (linkType != PDFLink.EXTERNAL) {
String pdfdest = "/FitR " + dest;
resourceContext.addAnnotation(
- pdfDoc.getFactory().makeLink(rect, pageRef, pdfdest));
+ pdfDoc.getFactory().makeLink(rect, getPageReference(), pdfdest));
} else {
resourceContext.addAnnotation(
pdfDoc.getFactory().makeLink(rect, dest, linkType, 0));
@@ -958,7 +966,7 @@ public class PDFGraphics2D extends AbstractGraphics2D {
PDFResources res = pdfDoc.getFactory().makeResources();
PDFResourceContext context = new PDFResourceContext(res);
PDFGraphics2D pattGraphic = new PDFGraphics2D(textAsShapes, specialFontInfo,
- pdfDoc, context, pageRef,
+ pdfDoc, context, getPageReference(),
"", 0);
pattGraphic.setGraphicContext(new GraphicContext());
pattGraphic.gc.validateTransformStack();
diff --git a/status.xml b/status.xml
index 4bd080975..a70aebb4d 100644
--- a/status.xml
+++ b/status.xml
@@ -58,6 +58,9 @@
Added SVG support for AFP (GOCA).
</action>
-->
+ <action context="Renderers" dev="JM" type="add" fixes-bug="44743" due-to="Yegor Kozlov">
+ Added a public accessor for reference to the current page to PDFGraphics2D.
+ </action>
<action context="Fonts" dev="JM" type="add" fixes-bug="44737" due-to="Jason Harrop">
Added support for auto-configuring TrueType Collections. XML font metrics files for
*.ttc fonts are not required anymore.