org.apache.fop.render.pcl
Class PCLRenderer

java.lang.Object
  extended by org.apache.fop.render.AbstractRenderer
      extended by org.apache.fop.render.PrintRenderer
          extended by org.apache.fop.render.pcl.PCLRenderer
All Implemented Interfaces:
Renderer

public class PCLRenderer
extends PrintRenderer

Renders areas to PCL.

Author:
Arthur E Welch III (while at M&I EastPoint Technology -- donated by EastPoint to the Apache FOP project March 2, 2001), Mark Lillywhite (to use the new Renderer interface)

Field Summary
 int curdiv
           
 PCLStream currentStream
          the current stream to add PCL commands to
 int leftmargin
           
 int orientation
           
 int paperheight
           
 int topmargin
           
 
Fields inherited from class org.apache.fop.render.PrintRenderer
currentFill, currentFontName, currentFontSize, currentStroke, fontInfo, prevLineThroughColor, prevLineThroughSize, prevLineThroughXEndPos, prevLineThroughYEndPos, prevOverlineColor, prevOverlineSize, prevOverlineXEndPos, prevOverlineYEndPos, prevUnderlineColor, prevUnderlineSize, prevUnderlineXEndPos, prevUnderlineYEndPos
 
Fields inherited from class org.apache.fop.render.AbstractRenderer
currentAreaContainerXPosition, currentXPosition, currentYPosition, idReferences, log
 
Constructor Summary
PCLRenderer()
          Create the PCL renderer
 
Method Summary
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 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
protected  void drawImageClipped(int x, int y, int clipX, int clipY, int clipW, int clipH, FopImage image, FontState fs)
          Renders an image, clipping it as specified.
protected  void drawImageScaled(int x, int y, int w, int h, FopImage image, FontState fs)
          Renders an image, scaling it to the given width and height.
 void render(Page page, OutputStream outputStream)
          render the given area tree to the given stream
 void renderForeignObjectArea(ForeignObjectArea area)
          render a foreign object area
 void renderImageArea(ImageArea area)
          render image area to PCL
 void renderPage(Page page)
          render page into PCL
 void renderSVGArea(SVGArea area)
          render SVG area to PCL
 void renderWordArea(WordArea area)
          render inline area to PCL
 void setFont(String name, float size)
           
 void setOptions(Map options)
          set up renderer options
 void setProducer(String producer)
          set the PCL document's producer
 void startRenderer(OutputStream outputStream)
          Default start renderer method.
 void stopRenderer(OutputStream outputStream)
          Default stop renderer method.
 
Methods inherited from class org.apache.fop.render.PrintRenderer
addFilledRect, addFilledRect, addWordLines, doFrame, renderDisplaySpace, renderInlineSpace, renderLeaderArea, setupFontInfo
 
Methods inherited from class org.apache.fop.render.AbstractRenderer
doBackground, drawImage, getIDReferences, renderAreaContainer, renderBlockArea, renderBodyAreaContainer, renderLineArea, renderRegionAreaContainer, renderRegions, renderSpanArea, setLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

currentStream

public PCLStream currentStream
the current stream to add PCL commands to


curdiv

public int curdiv

paperheight

public int paperheight

orientation

public int orientation

topmargin

public int topmargin

leftmargin

public int leftmargin
Constructor Detail

PCLRenderer

public PCLRenderer()
Create the PCL renderer

Method Detail

setOptions

public void setOptions(Map options)
set up renderer options


setProducer

public void setProducer(String producer)
set the PCL document's producer

Specified by:
setProducer in interface Renderer
Specified by:
setProducer in class PrintRenderer
Parameters:
producer - string indicating application producing PCL

addLine

protected void addLine(int x1,
                       int y1,
                       int x2,
                       int y2,
                       int th,
                       PDFPathPaint stroke)
add a line to the current stream

Specified by:
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

Specified by:
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

addRect

protected void addRect(int x,
                       int y,
                       int w,
                       int h,
                       PDFPathPaint stroke)
add a rectangle to the current stream

Specified by:
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

Specified by:
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

drawImageScaled

protected void drawImageScaled(int x,
                               int y,
                               int w,
                               int h,
                               FopImage image,
                               FontState fs)
Renders an image, scaling it to the given width and height. If the scaled width and height is the same intrinsic size of the image, the image is not scaled.

Specified by:
drawImageScaled in class AbstractRenderer
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
image - the image to be rendered
fs - the font state to use when rendering text in non-bitmapped images.

drawImageClipped

protected void drawImageClipped(int x,
                                int y,
                                int clipX,
                                int clipY,
                                int clipW,
                                int clipH,
                                FopImage image,
                                FontState fs)
Renders an image, clipping it as specified.

Specified by:
drawImageClipped in class AbstractRenderer
Parameters:
x - the x position of left edge in millipoints.
y - the y position of top edge in millipoints.
clipX - the left edge of the clip in millipoints
clipY - the top edge of the clip in millipoints
clipW - the clip width in millipoints
clipH - the clip height in millipoints
fill - the image to be rendered
fs - the font state to use when rendering text in non-bitmapped images.

renderImageArea

public void renderImageArea(ImageArea area)
render image area to PCL

Specified by:
renderImageArea in interface Renderer
Overrides:
renderImageArea in class AbstractRenderer
Parameters:
area - the image area to render

renderForeignObjectArea

public void renderForeignObjectArea(ForeignObjectArea area)
render a foreign object area

Specified by:
renderForeignObjectArea in interface Renderer
Specified by:
renderForeignObjectArea in class PrintRenderer

renderSVGArea

public void renderSVGArea(SVGArea area)
render SVG area to PCL

Specified by:
renderSVGArea in interface Renderer
Specified by:
renderSVGArea in class PrintRenderer
Parameters:
area - the SVG area to render

setFont

public void setFont(String name,
                    float size)

renderWordArea

public void renderWordArea(WordArea area)
render inline area to PCL

Specified by:
renderWordArea in interface Renderer
Specified by:
renderWordArea in class PrintRenderer
Parameters:
area - inline area to render

renderPage

public void renderPage(Page page)
render page into PCL

Specified by:
renderPage in interface Renderer
Specified by:
renderPage in class PrintRenderer
Parameters:
page - page to render

startRenderer

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

Specified by:
startRenderer in interface Renderer
Overrides:
startRenderer in class PrintRenderer
Throws:
IOException

stopRenderer

public void stopRenderer(OutputStream outputStream)
                  throws IOException
Description copied from class: PrintRenderer
Default stop renderer method. This would normally be overridden. (mark-fop@inomial.com).

Specified by:
stopRenderer in interface Renderer
Overrides:
stopRenderer in class PrintRenderer
Throws:
IOException

render

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

Throws:
IOException


Copyright ? 1999-2003 Apache Software Foundation. All Rights Reserved.