public class PageDrawer extends PDFStreamEngine
Modifier and Type | Field and Description |
---|---|
protected PDPage |
page
Current page to be rendered.
|
protected Dimension |
pageSize
Size of the page.
|
Constructor and Description |
---|
PageDrawer()
Default constructor, loads properties from file.
|
Modifier and Type | Method and Description |
---|---|
void |
colorChanged(boolean bStroking)
Deprecated.
|
void |
dispose()
Remove all cached resources.
|
void |
drawImage(Image awtImage,
AffineTransform at)
Draw the AWT image.
|
void |
drawPage(Graphics g,
PDPage p,
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.
|
Graphics2D |
getGraphics()
Get the graphics that we are currently drawing on.
|
GeneralPath |
getLinePath()
Get the current line path to be drawn.
|
PDPage |
getPage()
Get the page that is currently being drawn.
|
Dimension |
getPageSize()
Get the size of the page that is currently being drawn.
|
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(GeneralPath newLinePath)
Set the line path to draw.
|
void |
setStroke(BasicStroke newStroke)
This will set the current stroke.
|
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 |
shFill(COSName shadingName)
Fill with Shading.
|
void |
SHFill(COSName ShadingName)
Deprecated.
use
shFill(COSName) instead. |
void |
strokePath()
Stroke the path.
|
Point2D.Double |
transformedPoint(double x,
double y)
use the current transformation matrix to transform a single point.
|
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 Dimension pageSize
protected PDPage page
public PageDrawer() throws IOException
IOException
- If there is an error loading properties from the file.public void drawPage(Graphics g, PDPage p, Dimension pageDimension) throws IOException
g
- The graphics context to draw onto.p
- The page to draw.pageDimension
- The size of the page to draw.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 Graphics2D getGraphics()
public PDPage getPage()
public Dimension getPageSize()
public double fixY(double y)
y
- The y coordinate.public GeneralPath getLinePath()
public void setLinePath(GeneralPath newLinePath)
newLinePath
- Set the line path to draw.public void fillPath(int windingRule) throws IOException
windingRule
- The winding rule this path will use.IOException
- If there is an IO error while filling the path.public void setStroke(BasicStroke newStroke)
newStroke
- The current stroke.public BasicStroke getStroke()
public void strokePath() throws IOException
IOException
- If there is an IO error while stroking the path.@Deprecated public void colorChanged(boolean bStroking) throws IOException
bStroking
- true for the stroking color, false for the non-stroking colorIOException
- if an I/O error occurspublic 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(Image awtImage, AffineTransform at)
awtImage
- The image to draw.at
- The transformation to use when drawing.public void SHFill(COSName ShadingName) throws IOException
shFill(COSName)
instead.ShadingName
- The name of the Shading Dictionary to use for this fill instruction.IOException
- If there is an IO error while shade-filling the path/clipping area.public void shFill(COSName shadingName) throws IOException
shadingName
- The name of the Shading Dictionary to use for this fill instruction.IOException
- If there is an IO error while shade-filling the clipping area.protected void SHFill_Function(PDShading Shading) throws IOException
Shading
- The Shading Dictionary to use for this fill instruction.IOException
- If there is an IO error while shade-filling the path/clipping area.protected void SHFill_Axial(PDShading Shading) throws IOException
Shading
- The Shading Dictionary to use for this fill instruction.IOException
- If there is an IO error while shade-filling the path/clipping area.protected void SHFill_Radial(PDShading Shading) throws IOException
Shading
- The Shading Dictionary to use for this fill instruction.IOException
- If there is an IO error while shade-filling the path/clipping area.protected void SHFill_FreeGourad(PDShading Shading) throws IOException
Shading
- The Shading Dictionary to use for this fill instruction.IOException
- If there is an IO error while shade-filling the path/clipping area.protected void SHFill_LatticeGourad(PDShading Shading) throws IOException
Shading
- The Shading Dictionary to use for this fill instruction.IOException
- If there is an IO error while shade-filling the path/clipping area.protected void SHFill_CoonsPatch(PDShading Shading) throws IOException
Shading
- The Shading Dictionary to use for this fill instruction.IOException
- If there is an IO error while shade-filling the path/clipping area.protected void SHFill_TensorPatch(PDShading Shading) throws IOException
Shading
- The Shading Dictionary to use for this fill instruction.IOException
- If there is an IO error while shade-filling the path/clipping area.Copyright © 2002–2017 The Apache Software Foundation. All rights reserved.