org.apache.fop.render.ps
Class PSRenderer

java.lang.Object
  extended byorg.apache.fop.render.AbstractRenderer
      extended byorg.apache.fop.render.ps.PSRenderer
All Implemented Interfaces:
Renderer

public class PSRenderer
extends AbstractRenderer

Renderer that renders to PostScript.
This class currently generates PostScript Level 2 code. The only exception is the FlateEncode filter which is a Level 3 feature. The PostScript code generated follows the Document Structuring Conventions (DSC) version 3.0.

Author:
Jeremias Märki

Field Summary
protected  java.util.Map options
           
protected  PSStream out
          the stream used to output the PostScript
protected  java.lang.String producer
          the application producing the PostScript
 
Fields inherited from class org.apache.fop.render.AbstractRenderer
currentAreaContainerXPosition, currentXPosition, currentYPosition, idReferences, log
 
Constructor Summary
PSRenderer()
           
 
Method Summary
protected  void addFilledRect(int x, int y, int w, int h, ColorType col)
          Add a filled rectangle to the current stream This default implementation calls addRect using the same color for fill and border.
protected  void comment(java.lang.String comment)
          write out a comment
protected  void doFrame(Area area)
           
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.
 int getPSLevel()
           
 boolean isAutoRotateLandscape()
           
protected  void movetoCurrPosition()
           
 void render(Page page, java.io.OutputStream outputStream)
          render the given area tree to the given stream
 void renderBitmap(FopImage img, int x, int y, int w, int h)
           
 void renderDisplaySpace(DisplaySpace space)
          render a display space to PostScript
 void renderEPS(FopImage img, int x, int y, int w, int h)
           
 void renderForeignObjectArea(ForeignObjectArea area)
          render a foreign object area
 void renderImageArea(ImageArea area)
          Render an image area.
 void renderInlineSpace(InlineSpace space)
          render an inline space to PostScript
 void renderLeaderArea(LeaderArea area)
          render a leader area to PostScript
 void renderLineArea(LineArea area)
          render a line area to PostScript
 void renderPage(Page page)
          render a page to PostScript
 void renderSVGArea(SVGArea area)
          render an SVG area to PostScript
protected  void renderSVGDocument(org.w3c.dom.Document doc, int x, int y, FontState fs)
          render SVG document to PostScript
 void renderWordArea(WordArea area)
          render an inline area to PostScript
 void setAutoRotateLandscape(boolean value)
           
 void setOptions(java.util.Map options)
          set up renderer options
 void setProducer(java.lang.String producer)
          set the document's producer
 void setPSLevel(int level)
          Sets the PostScript Level to generate.
 void setupFontInfo(FontInfo fontInfo)
          set up the font info
 void startRenderer(java.io.OutputStream outputStream)
          Default start renderer method.
 void stopRenderer(java.io.OutputStream outputStream)
          Default stop renderer method.
 void useFont(java.lang.String name, int size)
           
protected  void write(java.lang.String cmd)
          write out a command
protected  void writeFontDict(FontInfo fontInfo)
           
protected  void writeProcs()
           
 
Methods inherited from class org.apache.fop.render.AbstractRenderer
doBackground, drawImage, getIDReferences, renderAreaContainer, renderBlockArea, renderBodyAreaContainer, renderRegionAreaContainer, renderRegions, renderSpanArea, setLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

producer

protected java.lang.String producer
the application producing the PostScript


out

protected PSStream out
the stream used to output the PostScript


options

protected java.util.Map options
Constructor Detail

PSRenderer

public PSRenderer()
Method Detail

setProducer

public void setProducer(java.lang.String producer)
set the document's producer

Parameters:
producer - string indicating application producing the PostScript

setOptions

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


setPSLevel

public void setPSLevel(int level)
Sets the PostScript Level to generate.

Parameters:
level - You can specify either 2 or 3 for the PostScript Level

getPSLevel

public int getPSLevel()

setAutoRotateLandscape

public void setAutoRotateLandscape(boolean value)

isAutoRotateLandscape

public boolean isAutoRotateLandscape()

write

protected void write(java.lang.String cmd)
write out a command


comment

protected void comment(java.lang.String comment)
write out a comment


writeProcs

protected void writeProcs()

writeFontDict

protected void writeFontDict(FontInfo fontInfo)

movetoCurrPosition

protected void movetoCurrPosition()

setupFontInfo

public void setupFontInfo(FontInfo fontInfo)
                   throws FOPException
set up the font info

Parameters:
fontInfo - the font info object to set up
Throws:
FOPException

addFilledRect

protected void addFilledRect(int x,
                             int y,
                             int w,
                             int h,
                             ColorType col)
Description copied from class: AbstractRenderer
Add a filled rectangle to the current stream This default implementation calls addRect using the same color for fill and border.

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

renderDisplaySpace

public void renderDisplaySpace(DisplaySpace space)
render a display space to PostScript

Parameters:
space - the space to render

renderForeignObjectArea

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


renderSVGArea

public void renderSVGArea(SVGArea area)
render an SVG area to PostScript

Parameters:
area - the area to render

renderSVGDocument

protected void renderSVGDocument(org.w3c.dom.Document doc,
                                 int x,
                                 int y,
                                 FontState fs)
render SVG document to PostScript

Parameters:
doc - the document to render
x - the x offset
y - the y offset
fs - the fontstate to use

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

renderEPS

public void renderEPS(FopImage img,
                      int x,
                      int y,
                      int w,
                      int h)

renderBitmap

public void renderBitmap(FopImage img,
                         int x,
                         int y,
                         int w,
                         int h)

renderImageArea

public void renderImageArea(ImageArea area)
Render an image area.

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

renderWordArea

public void renderWordArea(WordArea area)
render an inline area to PostScript

Parameters:
area - the area to render

useFont

public void useFont(java.lang.String name,
                    int size)

renderInlineSpace

public void renderInlineSpace(InlineSpace space)
render an inline space to PostScript

Parameters:
space - the space to render

renderLineArea

public void renderLineArea(LineArea area)
render a line area to PostScript

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

renderPage

public void renderPage(Page page)
render a page to PostScript

Parameters:
page - the page to render

renderLeaderArea

public void renderLeaderArea(LeaderArea area)
render a leader area to PostScript

Parameters:
area - the area to render

doFrame

protected void doFrame(Area area)
Specified by:
doFrame in class AbstractRenderer

startRenderer

public void startRenderer(java.io.OutputStream outputStream)
                   throws java.io.IOException
Default start renderer method. This would normally be overridden. (mark-fop@inomial.com).

Throws:
java.io.IOException

stopRenderer

public void stopRenderer(java.io.OutputStream outputStream)
                  throws java.io.IOException
Default stop renderer method. This would normally be overridden. (mark-fop@inomial.com).

Throws:
java.io.IOException

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-2003 Apache Software Foundation. All Rights Reserved.