|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.fop.render.AbstractRenderer | +--org.apache.fop.render.ps.PSRenderer
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 filters in use
are hardcoded at the moment.
This class follows the Document Structuring Conventions (DSC) version 3.0
(If I did everything right). If anyone modifies this renderer please make
sure to also follow the DSC to make it simpler to programmatically modify
the generated Postscript files (ex. extract pages etc.).
TODO: Character size/spacing, SVG Transcoder for Batik, configuration, move
to PrintRenderer, maybe improve filters (I'm not very proud of them), add a
RunLengthEncode filter (useful for Level 2 Postscript), Improve
DocumentProcessColors stuff (probably needs to be configurable, then maybe
add a color to grayscale conversion for bitmaps to make output smaller (See
PCLRenderer), font embedding, support different character encodings, try to
implement image transparency, positioning of images is wrong etc.
Modified by Mark Lillywhite mark-fop@inomial.com, to use the new Renderer interface. This PostScript renderer appears to be the most efficient at producing output.
Field Summary | |
protected IDReferences |
idReferences
|
protected java.util.Hashtable |
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, 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 |
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 to PostScript |
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 |
void |
renderWordArea(WordArea area)
render an inline area to PostScript |
void |
setOptions(java.util.Hashtable options)
set up renderer options |
void |
setProducer(java.lang.String producer)
set the document's producer |
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)
|
Methods inherited from class org.apache.fop.render.AbstractRenderer |
renderAreaContainer, renderBlockArea, renderBodyAreaContainer, renderSpanArea, setLogger |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected java.lang.String producer
protected PSStream out
protected IDReferences idReferences
protected java.util.Hashtable options
Constructor Detail |
public PSRenderer()
Method Detail |
public void setProducer(java.lang.String producer)
producer
- string indicating application producing the PostScriptpublic void setOptions(java.util.Hashtable options)
protected void write(java.lang.String cmd)
protected void comment(java.lang.String comment)
protected void writeFontDict(FontInfo fontInfo)
protected void movetoCurrPosition()
public void setupFontInfo(FontInfo fontInfo)
fontInfo
- the font info object to set upprotected void addFilledRect(int x, int y, int w, int h, ColorType col)
AbstractRenderer
addFilledRect
in class AbstractRenderer
org.apache.fop.render.AbstractRenderer
x
- the x position of left edge in millipointsy
- the y position of top edge in millipointsw
- the width in millipointsh
- the height in millipointsfill
- the fill color/gradientpublic void renderDisplaySpace(DisplaySpace space)
space
- the space to renderpublic void renderForeignObjectArea(ForeignObjectArea area)
public void renderSVGArea(SVGArea area)
area
- the area to renderpublic void renderEPS(FopImage img, int x, int y, int w, int h)
public void renderBitmap(FopImage img, int x, int y, int w, int h)
public void renderImageArea(ImageArea area)
area
- the area to renderpublic void renderWordArea(WordArea area)
area
- the area to renderpublic void useFont(java.lang.String name, int size)
public void renderInlineSpace(InlineSpace space)
space
- the space to renderpublic void renderLineArea(LineArea area)
renderLineArea
in class AbstractRenderer
area
- the area to renderpublic void renderPage(Page page)
page
- the page to renderpublic void renderLeaderArea(LeaderArea area)
area
- the area to renderprotected void doFrame(Area area)
doFrame
in class AbstractRenderer
public void startRenderer(java.io.OutputStream outputStream) throws java.io.IOException
public void stopRenderer(java.io.OutputStream outputStream) throws java.io.IOException
public void render(Page page, java.io.OutputStream outputStream)
Renderer
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |