Package org.apache.fop.render.pcl
Class PCLRenderingUtil
java.lang.Object
org.apache.fop.render.pcl.PCLRenderingUtil
Utility class for handling all sorts of peripheral tasks around PCL generation.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate boolean
Controls whether all text should be painted as text.private boolean
Controls whether the generation of PJL commands gets disabled.private float
Controls the dithering quality when rendering gray or color images.private static org.apache.commons.logging.Log
logging instanceprivate boolean
private PCLRenderingMode
Controls whether appearance is more important than speed.private boolean
private FOUserAgent
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic int
determinePrintDirection
(AffineTransform transform) Determines the print direction based on the given transformation matrix.float
Returns the dithering quality to be used when encoding gray or color images.Returns the selected rendering mode.Returns the user agent.private void
boolean
Indicates whether all text shall be painted as bitmaps.boolean
boolean
boolean
Indicates whether PJL generation is disabled.void
setAllTextAsBitmaps
(boolean allTextAsBitmaps) Controls whether all text should be generated as bitmaps or only text for which there's no native font.void
setColorEnabled
(boolean useColor) void
setOptimizeResources
(boolean b) void
setPJLDisabled
(boolean disable) Controls whether PJL commands shall be generated by the PCL renderer.void
Configures the renderer to trade speed for quality if desired.static Point2D
transformedPoint
(int x, int y, AffineTransform transform, PCLPageDefinition pageDefinition, int printDirection) Returns a coordinate in PCL's coordinate system when given a coordinate in the user coordinate system.
-
Field Details
-
log
private static org.apache.commons.logging.Log loglogging instance -
userAgent
-
renderingMode
Controls whether appearance is more important than speed. "SPEED" can cause some FO feature to be ignored (like the advanced borders). -
ditheringQuality
private float ditheringQualityControls the dithering quality when rendering gray or color images. -
useColor
private boolean useColor -
optimizeResources
private boolean optimizeResources -
disabledPJL
private boolean disabledPJLControls whether the generation of PJL commands gets disabled. -
allTextAsBitmaps
private boolean allTextAsBitmapsControls whether all text should be painted as text. This is a fallback setting in case the mixture of native and bitmapped text does not provide the necessary quality.
-
-
Constructor Details
-
PCLRenderingUtil
PCLRenderingUtil(FOUserAgent userAgent)
-
-
Method Details
-
initialize
private void initialize() -
getUserAgent
Returns the user agent.- Returns:
- the user agent
-
setRenderingMode
Configures the renderer to trade speed for quality if desired. One example here is the way that borders are rendered.- Parameters:
mode
- one of thePCLRenderingMode
.* constants
-
getRenderingMode
Returns the selected rendering mode.- Returns:
- the rendering mode
-
getDitheringQuality
public float getDitheringQuality()Returns the dithering quality to be used when encoding gray or color images.- Returns:
- the quality (0.0f..1.0f)
-
setPJLDisabled
public void setPJLDisabled(boolean disable) Controls whether PJL commands shall be generated by the PCL renderer.- Parameters:
disable
- true to disable PJL commands
-
isPJLDisabled
public boolean isPJLDisabled()Indicates whether PJL generation is disabled.- Returns:
- true if PJL generation is disabled.
-
setAllTextAsBitmaps
public void setAllTextAsBitmaps(boolean allTextAsBitmaps) Controls whether all text should be generated as bitmaps or only text for which there's no native font.- Parameters:
allTextAsBitmaps
- true if all text should be painted as bitmaps
-
isAllTextAsBitmaps
public boolean isAllTextAsBitmaps()Indicates whether all text shall be painted as bitmaps.- Returns:
- true if all text shall be painted as bitmaps
-
setColorEnabled
public void setColorEnabled(boolean useColor) -
isColorEnabled
public boolean isColorEnabled() -
determinePrintDirection
Determines the print direction based on the given transformation matrix. This method only detects right angles (0, 90, 180, 270). If any other angle is determined, 0 is returned.- Parameters:
transform
- the transformation matrix- Returns:
- the angle in degrees of the print direction.
-
transformedPoint
public static Point2D transformedPoint(int x, int y, AffineTransform transform, PCLPageDefinition pageDefinition, int printDirection) Returns a coordinate in PCL's coordinate system when given a coordinate in the user coordinate system.- Parameters:
x
- the X coordinatey
- the Y coordinatetransform
- the currently valid transformation matrixpageDefinition
- the currently valid page definitionprintDirection
- the currently valid print direction- Returns:
- the transformed point
-
isOptimizeResources
public boolean isOptimizeResources() -
setOptimizeResources
public void setOptimizeResources(boolean b)
-