org.apache.fop.render.txt
Class TXTRenderer

java.lang.Object
  |
  +--org.apache.fop.render.AbstractRenderer
        |
        +--org.apache.fop.render.PrintRenderer
              |
              +--org.apache.fop.render.txt.TXTRenderer
All Implemented Interfaces:
Renderer

public class TXTRenderer
extends PrintRenderer

Renderer that renders areas to plain text Modified by Mark Lillywhite mark-fop@inomial.com to use the new Renderer interface.


Field Summary
 int curdiv
           
 int leftmargin
           
 java.lang.String lineEnding
           
protected  java.util.Hashtable options
          options
 int orientation
           
 java.lang.String pageEnding
           
 boolean suppressGraphics
           
 float textCPI
           
 float textLPI
           
 int topmargin
           
 
Fields inherited from class org.apache.fop.render.PrintRenderer
currentFill, currentFontName, currentFontSize, currentStroke, fontInfo, idReferences, prevLineThroughColor, prevLineThroughSize, prevLineThroughXEndPos, prevLineThroughYEndPos, prevOverlineColor, prevOverlineSize, prevOverlineXEndPos, prevOverlineYEndPos, prevUnderlineColor, prevUnderlineSize, prevUnderlineXEndPos, prevUnderlineYEndPos
 
Fields inherited from class org.apache.fop.render.AbstractRenderer
currentAreaContainerXPosition, currentXPosition, currentYPosition, log
 
Constructor Summary
TXTRenderer()
           
 
Method Summary
protected  void addLine(float x1, float y1, float x2, float y2, PDFColor sc, float sw)
           
protected  void addLine(int x1, int y1, int x2, int y2, int th, int rs, PDFPathPaint stroke)
          add a line to the current stream
protected  void addLine(int x1, int y1, int x2, int y2, int th, PDFPathPaint stroke)
          add a line to the current stream
protected  void addPolyline(java.util.Vector points, int posx, int posy, PDFColor fc, PDFColor sc, float sw, boolean close)
           
protected  void addRect(float x, float y, float w, float h, float rx, float ry, PDFColor fc, PDFColor sc, float sw)
          add a filled rectangle to the current stream
protected  void addRect(int x, int y, int w, int h, PDFPathPaint stroke)
          add a rectangle to the current stream
protected  void addRect(int x, int y, int w, int h, PDFPathPaint stroke, PDFPathPaint fill)
          add a filled rectangle to the current stream
 void render(Page page, java.io.OutputStream outputStream)
          render the given area tree to the given stream
 void renderForeignObjectArea(ForeignObjectArea area)
          render a foreign object area
 void renderImage(FontState fontState, java.lang.String href, float x, float y, float width, float height)
           
 void renderImageArea(ImageArea area)
          render image area to PCL
 void renderInlineSpace(InlineSpace space)
          render inline space to Text
 void renderPage(Page page)
          render page into Text
 void renderSVGArea(SVGArea area)
          render SVG area to Text
 void renderWordArea(WordArea area)
          render inline area to Text
 void setOptions(java.util.Hashtable options)
          set up renderer options
 void setProducer(java.lang.String producer)
          set the TXT document's producer
 void startRenderer(java.io.OutputStream outputStream)
          Default start renderer method.
 void stopRenderer(java.io.OutputStream outputStream)
          In Mark's patch, this is endRenderer However, I couldn't see how it builds that way, so i changed it.
 
Methods inherited from class org.apache.fop.render.PrintRenderer
addFilledRect, addFilledRect, addWordLines, doFrame, renderDisplaySpace, renderLeaderArea, setupFontInfo
 
Methods inherited from class org.apache.fop.render.AbstractRenderer
renderAreaContainer, renderBlockArea, renderBodyAreaContainer, renderLineArea, renderSpanArea, setLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

curdiv

public int curdiv

orientation

public int orientation

topmargin

public int topmargin

leftmargin

public int leftmargin

textCPI

public float textCPI

textLPI

public float textLPI

lineEnding

public java.lang.String lineEnding

pageEnding

public java.lang.String pageEnding

suppressGraphics

public boolean suppressGraphics

options

protected java.util.Hashtable options
options
Constructor Detail

TXTRenderer

public TXTRenderer()
Method Detail

setOptions

public void setOptions(java.util.Hashtable options)
set up renderer options

setProducer

public void setProducer(java.lang.String producer)
set the TXT document's producer
Overrides:
setProducer in class PrintRenderer
Parameters:
producer - string indicating application producing PDF

addLine

protected void addLine(int x1,
                       int y1,
                       int x2,
                       int y2,
                       int th,
                       PDFPathPaint stroke)
add a line to the current stream
Overrides:
addLine in class PrintRenderer
Parameters:
x1 - the start x location in millipoints
y1 - the start y location in millipoints
x2 - the end x location in millipoints
y2 - the end y location in millipoints
th - the thickness in millipoints
stroke - the line color

addLine

protected void addLine(int x1,
                       int y1,
                       int x2,
                       int y2,
                       int th,
                       int rs,
                       PDFPathPaint stroke)
add a line to the current stream
Overrides:
addLine in class PrintRenderer
Parameters:
x1 - the start x location in millipoints
y1 - the start y location in millipoints
x2 - the end x location in millipoints
y2 - the end y location in millipoints
th - the thickness in millipoints
rs - the rule style
stroke - the line color

addLine

protected void addLine(float x1,
                       float y1,
                       float x2,
                       float y2,
                       PDFColor sc,
                       float sw)

addRect

protected void addRect(int x,
                       int y,
                       int w,
                       int h,
                       PDFPathPaint stroke)
add a rectangle to the current stream
Overrides:
addRect in class PrintRenderer
Parameters:
x - the x position of left edge in millipoints
y - the y position of top edge in millipoints
w - the width in millipoints
h - the height in millipoints
stroke - the stroke color/gradient

addRect

protected void addRect(int x,
                       int y,
                       int w,
                       int h,
                       PDFPathPaint stroke,
                       PDFPathPaint fill)
add a filled rectangle to the current stream
Overrides:
addRect in class PrintRenderer
Parameters:
x - the x position of left edge in millipoints
y - the y position of top edge in millipoints
w - the width in millipoints
h - the height in millipoints
fill - the fill color/gradient
stroke - the stroke color/gradient

addRect

protected void addRect(float x,
                       float y,
                       float w,
                       float h,
                       float rx,
                       float ry,
                       PDFColor fc,
                       PDFColor sc,
                       float sw)
add a filled rectangle to the current stream
Parameters:
x - the x position of left edge in millipoints
y - the y position of top edge in millipoints
w - the width in millipoints
h - the height in millipoints
r - the red component of edges
g - the green component of edges
b - the blue component of edges
fr - the red component of the fill
fg - the green component of the fill
fb - the blue component of the fill

addPolyline

protected void addPolyline(java.util.Vector points,
                           int posx,
                           int posy,
                           PDFColor fc,
                           PDFColor sc,
                           float sw,
                           boolean close)

renderImageArea

public void renderImageArea(ImageArea area)
render image area to PCL
Overrides:
renderImageArea in class PrintRenderer
Parameters:
area - the image area to render

renderImage

public void renderImage(FontState fontState,
                        java.lang.String href,
                        float x,
                        float y,
                        float width,
                        float height)

renderForeignObjectArea

public void renderForeignObjectArea(ForeignObjectArea area)
render a foreign object area
Overrides:
renderForeignObjectArea in class PrintRenderer

renderSVGArea

public void renderSVGArea(SVGArea area)
render SVG area to Text
Overrides:
renderSVGArea in class PrintRenderer
Parameters:
area - the SVG area to render

renderWordArea

public void renderWordArea(WordArea area)
render inline area to Text
Overrides:
renderWordArea in class PrintRenderer
Parameters:
area - inline area to render

renderInlineSpace

public void renderInlineSpace(InlineSpace space)
render inline space to Text
Overrides:
renderInlineSpace in class PrintRenderer
Parameters:
space - space to render

renderPage

public void renderPage(Page page)
render page into Text
Overrides:
renderPage in class PrintRenderer
Parameters:
page - page to render

startRenderer

public void startRenderer(java.io.OutputStream outputStream)
                   throws java.io.IOException
Description copied from class: PrintRenderer
Default start renderer method. This would normally be overridden. (mark-fop@inomial.com).
Overrides:
startRenderer in class PrintRenderer

stopRenderer

public void stopRenderer(java.io.OutputStream outputStream)
                  throws java.io.IOException
In Mark's patch, this is endRenderer However, I couldn't see how it builds that way, so i changed it. - Steve gears@apache.org
Overrides:
stopRenderer in class PrintRenderer

render

public void render(Page page,
                   java.io.OutputStream outputStream)
Description copied from interface: Renderer
render the given area tree to the given stream


Copyright © 1999-2002 Apache Software Foundation. All Rights Reserved.