From c95c1382d5062b466dd876e3152886705a56b724 Mon Sep 17 00:00:00 2001 From: Adrian Cumiskey Date: Fri, 4 Apr 2008 12:57:47 +0000 Subject: [PATCH] Merged revisions 644691,644697 via svnmerge from https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk ........ r644691 | jeremias | 2008-04-04 13:19:50 +0100 (Fri, 04 Apr 2008) | 3 lines Bugzilla #44743: Added a public accessor for reference to the current page to PDFGraphics2D. Submitted by: Yegor Kozlov ........ r644697 | jeremias | 2008-04-04 13:40:22 +0100 (Fri, 04 Apr 2008) | 2 lines Bugzilla #44744: Disable drawString(AttributedCharacterIterator, float, float) as it contains bugs and rely on the fallback implementation from AbstractGraphics2D. ........ git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/Temp_AFPGOCAResources@644700 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/fop/svg/PDFGraphics2D.java | 20 ++++++++++++------- status.xml | 3 +++ 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 Shape 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 @@ Added de-duplication and externalization support for IOCA and GOCA data resource objects. + + Added a public accessor for reference to the current page to PDFGraphics2D. + Added support for auto-configuring TrueType Collections. XML font metrics files for *.ttc fonts are not required anymore. -- 2.39.5