|
fop 0.95 | ||||||||||
| 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
Renderer for the PCL 5 printer language. It also uses HP GL/2 for certain graphic elements.
| Field Summary | |
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 |
| Fields inherited from class org.apache.fop.render.PrintRenderer |
fontInfo, fontList, 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. Subclasses can restore transformation matrices valid before the viewport area was started. |
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. (See Sect. 6.4.1.2 of XSL-FO spec.) |
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 |
renderPage(PageViewport page)
Tells the renderer to render a particular page. A renderer typically reponds by packing up the current page and writing it immediately to the output device. |
protected void |
renderReferenceArea(Block block)
Renders a block area that represents a reference area. The reference area establishes a new coordinate system. |
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. |
boolean |
setFont(java.lang.String name,
float size,
java.lang.String text)
Sets the current font (NOTE: Hard-coded font mappings ATM!) |
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 font info |
void |
startRenderer(java.io.OutputStream outputStream)
Initiates the rendering phase. This must only be called once for a rendering. If stopRenderer is called then this may be called again for a new document rendering. |
protected void |
startVParea(CTM ctm,
java.awt.geom.Rectangle2D clippingRect)
Establishes a new viewport area. |
void |
stopRenderer()
Signals the end of the rendering phase. The renderer should reset to an initial state and dispose of any resources for the completed rendering. |
protected void |
updateFillColor(java.awt.Color color)
Sets the new current fill color. |
| Methods inherited from class org.apache.fop.render.PrintRenderer |
addFontList, getFontFromArea, getFontResolver, getInternalFontNameForArea, lightenColor, 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
| Constructor Detail |
public PCLRenderer()
| Method Detail |
public 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 setupFontInfo(FontInfo inFontInfo)
setupFontInfo in interface RenderersetupFontInfo in class PrintRendererinFontInfo - font info to set upprotected 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 boolean setFont(java.lang.String name,
float size,
java.lang.String text)
throws java.io.IOException
name - the font name (internal F* names for now)size - the font sizetext - the text to be rendered (used to determine if there are non-printable chars)
java.io.IOException - if an I/O problem occurs
public void startRenderer(java.io.OutputStream outputStream)
throws java.io.IOException
startRenderer in interface RendererstartRenderer in class AbstractRendererjava.io.IOException
public void stopRenderer()
throws java.io.IOException
stopRenderer in interface RendererstopRenderer in class AbstractRendererjava.io.IOExceptionpublic java.lang.String getMimeType()
getMimeType in interface RenderergetMimeType in class AbstractRenderer
public void renderPage(PageViewport page)
throws java.io.IOException,
FOPException
renderPage in interface RendererrenderPage in class AbstractRendererjava.io.IOException
FOPExceptionprotected 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 setAllTextAsBitmaps(boolean allTextAsBitmaps)
allTextAsBitmaps - true if all text should be painted as bitmaps
|
fop 0.95 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||