aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKaren Lease <klease@apache.org>2001-03-22 22:28:36 +0000
committerKaren Lease <klease@apache.org>2001-03-22 22:28:36 +0000
commitbf9c64641acd1fef7c4b26ec666cf18bdb8e124b (patch)
treed1e988fa8581b365d865a6b3ff9a5b76bcc7ad0c /src
parent79842e11d3774bdb9d250a9e822d7b9343f22f6d (diff)
downloadxmlgraphics-fop-bf9c64641acd1fef7c4b26ec666cf18bdb8e124b.tar.gz
xmlgraphics-fop-bf9c64641acd1fef7c4b26ec666cf18bdb8e124b.zip
Submitted by: Art Welch
Make it easier to configure line endings and formfeed characters. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@194171 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src')
-rwxr-xr-xsrc/org/apache/fop/render/txt/TXTRenderer.java11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/org/apache/fop/render/txt/TXTRenderer.java b/src/org/apache/fop/render/txt/TXTRenderer.java
index 22833a826..98ffe018d 100755
--- a/src/org/apache/fop/render/txt/TXTRenderer.java
+++ b/src/org/apache/fop/render/txt/TXTRenderer.java
@@ -59,6 +59,9 @@ public class TXTRenderer extends PrintRenderer
int maxY = (int)(11f * textLPI + 1);
float xFactor;
float yFactor;
+ public String lineEnding = "\r\n"; // Every line except the last line on a page (which will end with pageEnding) will be terminated with this string.
+ public String pageEnding = "\f"; // Every page except the last one will end with this string.
+ public boolean suppressGraphics = false; // If true then graphics/decorations will not be rendered - text only.
/**
* create the TXT renderer
@@ -96,10 +99,10 @@ public class TXTRenderer extends PrintRenderer
if ( first )
first = false;
else
- currentStream.add("\f");
+ currentStream.add(pageEnding);
this.renderPage((Page) e.nextElement());
}
- currentStream.add("\n");
+ currentStream.add(lineEnding);
if ( !idReferences.isEveryIdValid() )
{
//throw new FOPException("The following id's were referenced but not found: "+idReferences.getInvalidIds()+"\n");
@@ -114,6 +117,8 @@ public class TXTRenderer extends PrintRenderer
{
if ( debug )
System.out.println("TXTRenderer.addStr(" + row + ", " + col + ", \"" + str + "\", " + ischar + ")");
+ if ( suppressGraphics && ! ischar )
+ return;
StringBuffer sb;
if ( row < 0 )
row = 0;
@@ -1734,7 +1739,7 @@ System.out.println("TXTRenderer.renderPage() maxX=" + maxX + " maxY=" + maxY + "
if ( outr != null )
currentStream.add(outr.toString());
if ( row < maxY )
- currentStream.add("\n");
+ currentStream.add(lineEnding);
}
// End page.