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;
}
/**
- * 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) {
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));
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();
* @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();
}
currentStream.write("ET\n");
- }
+ }*/
/**
* Fills the interior of a <code>Shape</code> using the settings of the
<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.