]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Merged revisions 644691,644697 via svnmerge from
authorAdrian Cumiskey <acumiskey@apache.org>
Fri, 4 Apr 2008 12:57:47 +0000 (12:57 +0000)
committerAdrian Cumiskey <acumiskey@apache.org>
Fri, 4 Apr 2008 12:57:47 +0000 (12:57 +0000)
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 <yegor.at.dinom.ru>
........
  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

src/java/org/apache/fop/svg/PDFGraphics2D.java
status.xml

index f6a7cbc3ba8cf09e66ded5e10b9cc06e003d9b85..05c30ef50b37b934b96957b6c3b1ec1cc22cc563 100644 (file)
@@ -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
index c3cbb010306703e4c0e6496dc14dcc140e1fc02c..1d2f91e60673dac5b283ab50813a6a49ad3836c1 100644 (file)
@@ -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.