aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Coffman <gears@apache.org>2001-09-05 18:13:19 +0000
committerSteve Coffman <gears@apache.org>2001-09-05 18:13:19 +0000
commit08f39c78ca6447b59b38c1e0c5c18962e4577c1e (patch)
treeb134b8b51401b67f1cebba00214b9778403aad6a
parent90d8d8dc3a70a82cead6f9e25e3eb94eec199345 (diff)
downloadxmlgraphics-fop-08f39c78ca6447b59b38c1e0c5c18962e4577c1e.tar.gz
xmlgraphics-fop-08f39c78ca6447b59b38c1e0c5c18962e4577c1e.zip
Jeremias Maerki's patch to fix page citations for PostScript rendering.
Is this broken in other renderers as well? git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@194452 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--src/org/apache/fop/render/ps/PSRenderer.java16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/org/apache/fop/render/ps/PSRenderer.java b/src/org/apache/fop/render/ps/PSRenderer.java
index a7836df34..3f8039545 100644
--- a/src/org/apache/fop/render/ps/PSRenderer.java
+++ b/src/org/apache/fop/render/ps/PSRenderer.java
@@ -108,6 +108,8 @@ public class PSRenderer extends AbstractRenderer {
private FontInfo fontInfo;
+ protected IDReferences idReferences;
+
protected Hashtable options;
@@ -611,8 +613,18 @@ public class PSRenderer extends AbstractRenderer {
FontState fs = area.getFontState();
String fontWeight = fs.getFontWeight();
StringBuffer sb = new StringBuffer();
- String s = area.getText();
+ String s;
+ if (area.getPageNumberID()
+ != null) { // this text is a page number, so resolve it
+ s = idReferences.getPageNumber(area.getPageNumberID());
+ if (s == null) {
+ s = "";
+ }
+ } else {
+ s = area.getText();
+ }
int l = s.length();
+
for (int i = 0; i < l; i++) {
char ch = s.charAt(i);
char mch = fs.mapChar(ch);
@@ -709,6 +721,8 @@ public class PSRenderer extends AbstractRenderer {
* @param page the page to render
*/
public void renderPage(Page page) {
+ this.idReferences = page.getIDReferences();
+
BodyAreaContainer body;
AreaContainer before, after;
write("%%Page: " + page.getNumber() + " " + page.getNumber());