aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/java/org/apache/fop/svg/PDFGraphics2D.java20
-rw-r--r--status.xml3
2 files changed, 16 insertions, 7 deletions
diff --git a/src/java/org/apache/fop/svg/PDFGraphics2D.java b/src/java/org/apache/fop/svg/PDFGraphics2D.java
index f6a7cbc3b..05c30ef50 100644
--- a/src/java/org/apache/fop/svg/PDFGraphics2D.java
+++ b/src/java/org/apache/fop/svg/PDFGraphics2D.java
@@ -50,8 +50,6 @@ import java.awt.image.renderable.RenderableImage;
import java.io.IOException;
import java.io.OutputStream;
import java.io.StringWriter;
-import java.text.AttributedCharacterIterator;
-import java.text.CharacterIterator;
import java.util.List;
import java.util.Map;
@@ -304,7 +302,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 +396,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 +964,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();
@@ -1512,7 +1518,7 @@ public class PDFGraphics2D extends AbstractGraphics2D {
* @see #setTransform
* @see #setComposite
* @see #setClip
- */
+ *//* TODO Reimplement for higher efficiency similar to the way it was done in PDFTextPainter
public void drawString(AttributedCharacterIterator iterator, float x,
float y) {
preparePainting();
@@ -1577,7 +1583,7 @@ public class PDFGraphics2D extends AbstractGraphics2D {
}
currentStream.write("ET\n");
- }
+ }*/
/**
* Fills the interior of a <code>Shape</code> using the settings of the
diff --git a/status.xml b/status.xml
index c3cbb0103..1d2f91e60 100644
--- a/status.xml
+++ b/status.xml
@@ -59,6 +59,9 @@
<action context="Renderers" dev="AC" importance="high" type="add">
Added de-duplication and externalization support for IOCA and GOCA data resource objects.
</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.