|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.pdfbox.util.PDFStreamEngine
org.apache.pdfbox.pdfviewer.PageDrawer
public class PageDrawer
This will paint a page in a PDF document to a graphics context.
Field Summary | |
---|---|
protected PDPage |
page
Current page to be rendered. |
protected Dimension |
pageSize
Size of the page. |
Constructor Summary | |
---|---|
PageDrawer()
Default constructor, loads properties from file. |
Method Summary | |
---|---|
void |
colorChanged(boolean bStroking)
Deprecated. |
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 |
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)
Set the clipping Path. |
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 {@link #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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Dimension pageSize
protected PDPage page
Constructor Detail |
---|
public PageDrawer() throws IOException
IOException
- If there is an error loading properties from the file.Method Detail |
---|
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.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 color
IOException
- 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 transform
public void setClippingPath(int windingRule)
windingRule
- The winding rule this path will use.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
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.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |