diff options
author | Jordan Naftolin <jordan@apache.org> | 2000-07-05 23:06:58 +0000 |
---|---|---|
committer | Jordan Naftolin <jordan@apache.org> | 2000-07-05 23:06:58 +0000 |
commit | f7e34078275baa7d0845bc76374fda4a5097c672 (patch) | |
tree | 93197154fe9bba37ef4b00310c068072fd1956f7 /src/org/apache/fop/render | |
parent | ab19f336d7ff76b0d1e75ea8fda7e70ddadbe3ff (diff) | |
download | xmlgraphics-fop-f7e34078275baa7d0845bc76374fda4a5097c672.tar.gz xmlgraphics-fop-f7e34078275baa7d0845bc76374fda4a5097c672.zip |
Added basic support for forward page-number-citations
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@193455 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/org/apache/fop/render')
-rw-r--r-- | src/org/apache/fop/render/pdf/PDFRenderer.java | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/org/apache/fop/render/pdf/PDFRenderer.java b/src/org/apache/fop/render/pdf/PDFRenderer.java index db68fe764..0fe1609a7 100644 --- a/src/org/apache/fop/render/pdf/PDFRenderer.java +++ b/src/org/apache/fop/render/pdf/PDFRenderer.java @@ -74,13 +74,16 @@ import java.util.Vector; * Renderer that renders areas to PDF */ public class PDFRenderer implements Renderer { - + /** the PDF Document being created */ protected PDFDocument pdfDoc; /** the /Resources object of the PDF document being created */ protected PDFResources pdfResources; + /** the IDReferences for this document */ + protected IDReferences idReferences; + /** the current stream to add PDF commands to */ PDFStream currentStream; @@ -145,7 +148,7 @@ public class PDFRenderer implements Renderer { public void render(AreaTree areaTree, PrintWriter writer) throws IOException, FOPException { MessageHandler.logln("rendering areas to PDF"); - IDReferences idReferences=areaTree.getIDReferences(); + idReferences=areaTree.getIDReferences(); this.pdfResources = this.pdfDoc.getResources(); this.pdfDoc.setIDReferences(idReferences); Enumeration e = areaTree.getPages().elements(); @@ -431,7 +434,14 @@ public class PDFRenderer implements Renderer { +(rx/1000f) + " " + (bl/1000f) + " Tm ("); - String s = area.getText(); + String s; + if ( area.getPageNumberID()!=null ) { // this text is a page number, so resolve it + s = idReferences.getPageNumber(area.getPageNumberID()); + } + else { + s = area.getText(); + } + int l = s.length(); for (int i=0; i < l; i++) { |