public class PageDrawer extends PDFStreamEngine
Modifier and Type | Field | Description |
---|---|---|
protected PDPage |
page |
Current page to be rendered.
|
protected java.awt.Dimension |
pageSize |
Size of the page.
|
Constructor | Description |
---|---|
PageDrawer() |
Default constructor, loads properties from file.
|
Modifier and Type | Method | Description |
---|---|---|
void |
colorChanged(boolean bStroking) |
Deprecated.
|
void |
dispose() |
Remove all cached resources.
|
void |
drawImage(java.awt.Image awtImage,
java.awt.geom.AffineTransform at) |
Draw the AWT image.
|
void |
drawPage(java.awt.Graphics g,
PDPage p,
java.awt.Dimension pageDimension) |
This will draw the page to the requested context.
|
void |
endPath() |
Set the clipping Path.
|
void |
fillPath(int windingRule) |
Fill the path.
|
double |
fixY(double y) |
Fix the y coordinate.
|
java.awt.Graphics2D |
getGraphics() |
Get the graphics that we are currently drawing on.
|
java.awt.geom.GeneralPath |
getLinePath() |
Get the current line path to be drawn.
|
PDPage |
getPage() |
Get the page that is currently being drawn.
|
java.awt.Dimension |
getPageSize() |
Get the size of the page that is currently being drawn.
|
java.awt.BasicStroke |
getStroke() |
This will return the current stroke.
|
protected void |
processTextPosition(TextPosition text) |
You should override this method if you want to perform an action when a
text is being processed.
|
void |
setClippingPath(int windingRule) |
Deprecated.
use
setClippingWindingRule(int) instead |
void |
setClippingWindingRule(int windingRule) |
Set the clipping winding rule.
|
void |
setLinePath(java.awt.geom.GeneralPath newLinePath) |
Set the line path to draw.
|
void |
setStroke(java.awt.BasicStroke newStroke) |
This will set the current stroke.
|
void |
shFill(COSName shadingName) |
Fill with Shading.
|
void |
SHFill(COSName ShadingName) |
Deprecated.
use
shFill(COSName) instead. |
protected void |
SHFill_Axial(PDShading Shading) |
Fill with an Axial Shading.
|
protected void |
SHFill_CoonsPatch(PDShading Shading) |
Fill with a Coons patch mesh
If extending the class, override this and its siblings, not the public SHFill method.
|
protected void |
SHFill_FreeGourad(PDShading Shading) |
Fill with a Free-form Gourad-shaded triangle mesh.
|
protected void |
SHFill_Function(PDShading Shading) |
Fill with a Function-based gradient / shading.
|
protected void |
SHFill_LatticeGourad(PDShading Shading) |
Fill with a Lattice-form Gourad-shaded triangle mesh.
|
protected void |
SHFill_Radial(PDShading Shading) |
Fill with a Radial gradient / shading.
|
protected void |
SHFill_TensorPatch(PDShading Shading) |
Fill with a Tensor-product patch mesh.
|
void |
strokePath() |
Stroke the path.
|
java.awt.geom.Point2D.Double |
transformedPoint(double x,
double y) |
use the current transformation matrix to transform a single point.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getColorSpaces, getCurrentPage, getFonts, getGraphicsStack, getGraphicsState, getGraphicsStates, getResources, getTextLineMatrix, getTextMatrix, getTotalCharCnt, getValidCharCnt, getXObjects, inspectFontEncoding, isForceParsing, processEncodedText, processOperator, processOperator, processStream, processSubStream, registerOperatorProcessor, resetEngine, setColorSpaces, setFonts, setForceParsing, setGraphicsStack, setGraphicsState, setGraphicsStates, setTextLineMatrix, setTextMatrix
protected java.awt.Dimension pageSize
protected PDPage page
public PageDrawer() throws java.io.IOException
java.io.IOException
- If there is an error loading properties from the file.public void drawPage(java.awt.Graphics g, PDPage p, java.awt.Dimension pageDimension) throws java.io.IOException
g
- The graphics context to draw onto.p
- The page to draw.pageDimension
- The size of the page to draw.java.io.IOException
- If there is an IO error while drawing the page.public void dispose()
protected void processTextPosition(TextPosition text)
processTextPosition
in class PDFStreamEngine
text
- The text to processpublic java.awt.Graphics2D getGraphics()
public PDPage getPage()
public java.awt.Dimension getPageSize()
public double fixY(double y)
y
- The y coordinate.public java.awt.geom.GeneralPath getLinePath()
public void setLinePath(java.awt.geom.GeneralPath newLinePath)
newLinePath
- Set the line path to draw.public void fillPath(int windingRule) throws java.io.IOException
windingRule
- The winding rule this path will use.java.io.IOException
- If there is an IO error while filling the path.public void setStroke(java.awt.BasicStroke newStroke)
newStroke
- The current stroke.public java.awt.BasicStroke getStroke()
public void strokePath() throws java.io.IOException
java.io.IOException
- If there is an IO error while stroking the path.@Deprecated public void colorChanged(boolean bStroking) throws java.io.IOException
bStroking
- true for the stroking color, false for the non-stroking colorjava.io.IOException
- if an I/O error occurspublic java.awt.geom.Point2D.Double transformedPoint(double x, double y)
x
- x-coordinate of the point to be transformy
- y-coordinate of the point to be transformpublic void setClippingPath(int windingRule)
setClippingWindingRule(int)
insteadwindingRule
- The winding rule this path will use.public void setClippingWindingRule(int windingRule)
windingRule
- The winding rule which will be used for clipping.public void endPath()
public void drawImage(java.awt.Image awtImage, java.awt.geom.AffineTransform at)
awtImage
- The image to draw.at
- The transformation to use when drawing.public void SHFill(COSName ShadingName) throws java.io.IOException
shFill(COSName)
instead.ShadingName
- The name of the Shading Dictionary to use for this fill instruction.java.io.IOException
- If there is an IO error while shade-filling the path/clipping area.public void shFill(COSName shadingName) throws java.io.IOException
shadingName
- The name of the Shading Dictionary to use for this fill instruction.java.io.IOException
- If there is an IO error while shade-filling the clipping area.protected void SHFill_Function(PDShading Shading) throws java.io.IOException
Shading
- The Shading Dictionary to use for this fill instruction.java.io.IOException
- If there is an IO error while shade-filling the path/clipping area.protected void SHFill_Axial(PDShading Shading) throws java.io.IOException
Shading
- The Shading Dictionary to use for this fill instruction.java.io.IOException
- If there is an IO error while shade-filling the path/clipping area.protected void SHFill_Radial(PDShading Shading) throws java.io.IOException
Shading
- The Shading Dictionary to use for this fill instruction.java.io.IOException
- If there is an IO error while shade-filling the path/clipping area.protected void SHFill_FreeGourad(PDShading Shading) throws java.io.IOException
Shading
- The Shading Dictionary to use for this fill instruction.java.io.IOException
- If there is an IO error while shade-filling the path/clipping area.protected void SHFill_LatticeGourad(PDShading Shading) throws java.io.IOException
Shading
- The Shading Dictionary to use for this fill instruction.java.io.IOException
- If there is an IO error while shade-filling the path/clipping area.protected void SHFill_CoonsPatch(PDShading Shading) throws java.io.IOException
Shading
- The Shading Dictionary to use for this fill instruction.java.io.IOException
- If there is an IO error while shade-filling the path/clipping area.protected void SHFill_TensorPatch(PDShading Shading) throws java.io.IOException
Shading
- The Shading Dictionary to use for this fill instruction.java.io.IOException
- If there is an IO error while shade-filling the path/clipping area.