|
fop svn-trunk | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.fop.render.AbstractRenderer
org.apache.fop.render.PrintRenderer
org.apache.fop.render.pcl.PCLRenderer
public class PCLRenderer
Renderer for the PCL 5 printer language. It also uses HP GL/2 for certain graphic elements.
| Field Summary | |
|---|---|
static java.lang.Object |
COLOR_CANVAS
Enables/Disables a color canvas for bitmap production (required for SVG, for example) |
static java.lang.Object |
DISABLE_CLIPPING
Disable clipping |
protected PCLGenerator |
gen
The PCL generator |
static java.lang.String |
MIME_TYPE
The MIME type for PCL |
protected java.io.OutputStream |
out
The OutputStream to write the PCL stream to |
static org.apache.xmlgraphics.util.QName |
SRC_TRANSPARENCY
Source transparency mode |
| Fields inherited from class org.apache.fop.render.PrintRenderer |
|---|
embedFontInfoList, fontInfo, fontResolver |
| Fields inherited from class org.apache.fop.render.AbstractRenderer |
|---|
containingBPPosition, containingIPPosition, currentBPPosition, currentIPPosition, currentPageViewport, userAgent |
| Fields inherited from interface org.apache.fop.render.Renderer |
|---|
ROLE |
| Constructor Summary | |
|---|---|
PCLRenderer()
Create the PCL renderer |
|
| Method Summary | |
|---|---|
protected void |
clip()
Clip using the current path. |
protected void |
clipRect(float x,
float y,
float width,
float height)
Clip an area. |
protected void |
closePath()
Closes the current subpath by appending a straight line segment from the current point to the starting point of the subpath. |
protected void |
concatenateTransformationMatrix(java.awt.geom.AffineTransform at)
Concatenates the current transformation matrix with the given one, therefore establishing a new coordinate system. |
protected RendererContext |
createRendererContext(int x,
int y,
int width,
int height,
java.util.Map foreignAttributes)
Creates a RendererContext for an image. |
protected void |
drawBackAndBorders(Area area,
float startx,
float starty,
float width,
float height)
Draw the background and borders. |
protected void |
drawBorders(java.awt.geom.Rectangle2D.Float borderRect,
BorderProps bpsBefore,
BorderProps bpsAfter,
BorderProps bpsStart,
BorderProps bpsEnd)
Draws borders. |
protected void |
drawFastBorders(java.awt.geom.Rectangle2D.Float borderRect,
BorderProps bpsBefore,
BorderProps bpsAfter,
BorderProps bpsStart,
BorderProps bpsEnd)
Draws borders. |
protected void |
drawImage(java.lang.String uri,
java.awt.geom.Rectangle2D pos,
java.util.Map foreignAttributes)
Draw an image at the indicated location. |
protected void |
drawQualityBorders(java.awt.geom.Rectangle2D.Float borderRect,
BorderProps bpsBefore,
BorderProps bpsAfter,
BorderProps bpsStart,
BorderProps bpsEnd)
Draws borders. |
protected void |
endVParea()
Signals exit from a viewport area. |
protected void |
fillRect(float x,
float y,
float width,
float height)
Fill a rectangular area. |
org.apache.xmlgraphics.java2d.GraphicContext |
getGraphicContext()
|
Graphics2DAdapter |
getGraphics2DAdapter()
|
java.lang.String |
getMimeType()
Get the MIME type of the renderer. |
protected int |
getResolution()
|
protected void |
handleBlockTraits(Block block)
Handle block traits. |
protected void |
handleIOTrouble(java.io.IOException ioe)
Central exception handler for I/O exceptions. |
protected void |
handleRegionTraits(RegionViewport region)
Handle the traits for a region This is used to draw the traits for the given page region. |
boolean |
isPJLDisabled()
Indicates whether PJL generation is disabled. |
protected void |
lineTo(float x,
float y)
Appends a straight line segment from the current point to (x, y). |
protected void |
moveTo(float x,
float y)
Moves the current point to (x, y), omitting any connecting line segment. |
protected void |
renderBlockViewport(BlockViewport bv,
java.util.List children)
Renders a block viewport. |
protected void |
renderFlow(NormalFlow flow)
Renders a flow reference area. |
void |
renderForeignObject(ForeignObject fo,
java.awt.geom.Rectangle2D pos)
Renders a foreign object area. |
void |
renderImage(Image image,
java.awt.geom.Rectangle2D pos)
Renders an image area. |
protected void |
renderInlineAreaBackAndBorders(InlineArea area)
Common method to render the background and borders for any inline area. |
void |
renderLeader(Leader area)
Render the given Leader. |
void |
renderPage(PageViewport page)
Tells the renderer to render a particular page. |
protected void |
renderReferenceArea(Block block)
Renders a block area that represents a reference area. |
protected void |
renderSpace(SpaceArea space)
Render the given SpaceArea. |
protected void |
renderText(TextArea text)
Render the given TextArea. |
void |
renderViewport(Viewport viewport)
Render an inline viewport. |
protected void |
renderWord(WordArea word)
Render the given WordArea. |
protected void |
restoreGraphicsState()
Restores the last graphics state from the stack. |
protected void |
saveGraphicsState()
Saves the current graphics state on the stack. |
void |
setAllTextAsBitmaps(boolean allTextAsBitmaps)
Controls whether all text should be generated as bitmaps or only text for which there's no native font. |
void |
setPJLDisabled(boolean disable)
Controls whether PJL commands shall be generated by the PCL renderer. |
void |
setQualityBeforeSpeed(boolean qualityBeforeSpeed)
Configures the renderer to trade speed for quality if desired. |
void |
setupFontInfo(FontInfo inFontInfo)
Set up the given FontInfo. |
void |
setUserAgent(FOUserAgent agent)
Set the User Agent. |
void |
startRenderer(java.io.OutputStream outputStream)
Initiates the rendering phase. |
protected void |
startVParea(CTM ctm,
java.awt.geom.Rectangle2D clippingRect)
Establishes a new viewport area. |
void |
stopRenderer()
Signals the end of the rendering phase. |
protected void |
updateFillColor(java.awt.Color color)
Sets the new current fill color. |
| Methods inherited from class org.apache.fop.render.PrintRenderer |
|---|
addFontList, getFontFromArea, getFontInfo, getFontList, getFontResolver, getInternalFontNameForArea, instantiateRendererContext, renderDocument, setFontList |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String MIME_TYPE
protected java.io.OutputStream out
protected PCLGenerator gen
public static final org.apache.xmlgraphics.util.QName SRC_TRANSPARENCY
public static final java.lang.Object DISABLE_CLIPPING
public static final java.lang.Object COLOR_CANVAS
| Constructor Detail |
|---|
public PCLRenderer()
| Method Detail |
|---|
public void setUserAgent(FOUserAgent agent)
setUserAgent in interface RenderersetUserAgent in class AbstractRendereragent - The User Agentpublic void setQualityBeforeSpeed(boolean qualityBeforeSpeed)
qualityBeforeSpeed - true if quality is more important than speedpublic void setPJLDisabled(boolean disable)
disable - true to disable PJL commandspublic boolean isPJLDisabled()
public void setAllTextAsBitmaps(boolean allTextAsBitmaps)
allTextAsBitmaps - true if all text should be painted as bitmapspublic void setupFontInfo(FontInfo inFontInfo)
setupFontInfo in interface RenderersetupFontInfo in class PrintRendererinFontInfo - The font informationprotected void handleIOTrouble(java.io.IOException ioe)
ioe - IOException to handlepublic Graphics2DAdapter getGraphics2DAdapter()
getGraphics2DAdapter in interface RenderergetGraphics2DAdapter in class AbstractRendererpublic org.apache.xmlgraphics.java2d.GraphicContext getGraphicContext()
protected int getResolution()
public void startRenderer(java.io.OutputStream outputStream)
throws java.io.IOException
startRenderer in interface RendererstartRenderer in class AbstractRendereroutputStream - The OutputStream to use for output
java.io.IOException - If an I/O error occurs
public void stopRenderer()
throws java.io.IOException
stopRenderer in interface RendererstopRenderer in class AbstractRendererjava.io.IOException - If an I/O error occurspublic java.lang.String getMimeType()
getMimeType in interface Renderer
public void renderPage(PageViewport page)
throws java.io.IOException,
FOPException
renderPage in interface RendererrenderPage in class AbstractRendererpage - The page to be rendered
java.io.IOException - if an I/O error occurs
FOPException - if a FOP interal error occurs.protected void saveGraphicsState()
protected void restoreGraphicsState()
protected void clipRect(float x,
float y,
float width,
float height)
x - the x coordinatey - the y coordinatewidth - the width of the areaheight - the height of the area
protected void startVParea(CTM ctm,
java.awt.geom.Rectangle2D clippingRect)
startVParea in class AbstractRendererctm - the coordinate transformation matrix to useclippingRect - the clipping rectangle if the viewport should be clipping,
null if no clipping is performed.protected void endVParea()
endVParea in class AbstractRendererprotected void handleBlockTraits(Block block)
handleBlockTraits in class AbstractRendererblock - the block to render the traitsprotected void handleRegionTraits(RegionViewport region)
handleRegionTraits in class AbstractRendererregion - the RegionViewport whose region is to be drawnprotected void renderText(TextArea text)
renderText in class AbstractRenderertext - the text to renderprotected void clip()
protected void closePath()
protected void lineTo(float x,
float y)
x - x coordinatey - y coordinate
protected void moveTo(float x,
float y)
x - x coordinatey - y coordinate
protected void fillRect(float x,
float y,
float width,
float height)
x - the x coordinate (in pt)y - the y coordinate (in pt)width - the width of the rectangleheight - the height of the rectangleprotected void updateFillColor(java.awt.Color color)
color - the colorprotected void renderWord(WordArea word)
renderWord in class AbstractRendererword - the word to renderprotected void renderSpace(SpaceArea space)
renderSpace in class AbstractRendererspace - the space to renderpublic void renderViewport(Viewport viewport)
renderViewport in class AbstractRendererviewport - the viewport to handle
protected void renderBlockViewport(BlockViewport bv,
java.util.List children)
renderBlockViewport in class AbstractRendererbv - The block viewportchildren - The children to render within the block viewportprotected void renderReferenceArea(Block block)
renderReferenceArea in class AbstractRendererblock - the block areaprotected void renderFlow(NormalFlow flow)
renderFlow in class AbstractRendererflow - The flow reference areaprotected void concatenateTransformationMatrix(java.awt.geom.AffineTransform at)
at - the transformation matrix to process (coordinates in points)
protected RendererContext createRendererContext(int x,
int y,
int width,
int height,
java.util.Map foreignAttributes)
createRendererContext in class PrintRendererx - the x coordinate (in millipoints)y - the y coordinate (in millipoints)width - the width of the image (in millipoints)height - the height of the image (in millipoints)foreignAttributes - a Map or foreign attributes, may be null
public void renderImage(Image image,
java.awt.geom.Rectangle2D pos)
renderImage in class AbstractRendererimage - The imagepos - The target position of the image
(todo) Make renderImage() protected
protected void drawImage(java.lang.String uri,
java.awt.geom.Rectangle2D pos,
java.util.Map foreignAttributes)
uri - the URI/URL of the imagepos - the position of the imageforeignAttributes - an optional Map with foreign attributes, may be null
public void renderForeignObject(ForeignObject fo,
java.awt.geom.Rectangle2D pos)
renderForeignObject in class AbstractRendererfo - The foreign object areapos - The target position of the foreign object
(todo) Make renderForeignObject() protectedprotected void renderInlineAreaBackAndBorders(InlineArea area)
renderInlineAreaBackAndBorders in class AbstractRendererarea - the inline area for which the background, border and padding is to be
rendered
protected void drawBackAndBorders(Area area,
float startx,
float starty,
float width,
float height)
area - the area whose traits are usedstartx - the start x positionstarty - the start y positionwidth - the width of the areaheight - the height of the area
protected void drawBorders(java.awt.geom.Rectangle2D.Float borderRect,
BorderProps bpsBefore,
BorderProps bpsAfter,
BorderProps bpsStart,
BorderProps bpsEnd)
borderRect - the border rectanglebpsBefore - the border specification on the before sidebpsAfter - the border specification on the after sidebpsStart - the border specification on the start sidebpsEnd - the border specification on the end side
protected void drawFastBorders(java.awt.geom.Rectangle2D.Float borderRect,
BorderProps bpsBefore,
BorderProps bpsAfter,
BorderProps bpsStart,
BorderProps bpsEnd)
borderRect - the border rectanglebpsBefore - the border specification on the before sidebpsAfter - the border specification on the after sidebpsStart - the border specification on the start sidebpsEnd - the border specification on the end side
protected void drawQualityBorders(java.awt.geom.Rectangle2D.Float borderRect,
BorderProps bpsBefore,
BorderProps bpsAfter,
BorderProps bpsStart,
BorderProps bpsEnd)
borderRect - the border rectanglebpsBefore - the border specification on the before sidebpsAfter - the border specification on the after sidebpsStart - the border specification on the start sidebpsEnd - the border specification on the end sidepublic void renderLeader(Leader area)
renderLeader in class AbstractRendererarea - the leader to render
|
fop svn-trunk | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||