org.pdfbox.pdfviewer
Class PageDrawer
This will paint a page in a PDF document to a graphics context.
PageDrawer() - Default constructor, loads properties from file.
|
void | drawPage(Graphics g, PDPage p, Dimension pageDimension) - This will draw the page to the requested context.
|
double | fixY(double x, double y) - Fix the y coordinate based on page rotation.
|
Graphics2D | getGraphics() - Get the graphics that we are currently drawing on.
|
GeneralPath | getLinePath() - Get the current line path to be drawn.
|
List | getLineSubPaths() - Get the current list of line paths to be drawn.
|
Color | getNonStrokingColor() - Get the non stroking color.
|
PDPage | getPage() - Get the page that is currently being drawn.
|
Dimension | getPageSize() - Get the size of the page that is currently being drawn.
|
Color | getStrokingColor() - Get the stroking color.
|
void | setLinePath(GeneralPath newLinePath) - Set the line path to draw.
|
void | setLineSubPaths(List newLineSubPaths) - Set the list of line paths to draw.
|
void | setNonStrokingColor(Color newNonStrokingColor) - Set the non stroking color.
|
void | setStrokingColor(Color newStrokingColor) - Set the stroking color.
|
protected void | showCharacter(TextPosition text) - You should override this method if you want to perform an action when a
string is being shown.
|
getColorSpaces , getCurrentPage , getFonts , getGraphicsStack , getGraphicsState , getGraphicsStates , getResources , getTextLineMatrix , getTextMatrix , getXObjects , processOperator , processOperator , processStream , processSubStream , registerOperatorProcessor , resetEngine , setColorSpaces , setFonts , setGraphicsStack , setGraphicsState , setGraphicsStates , setTextLineMatrix , setTextMatrix , showCharacter , showString |
PageDrawer
public PageDrawer()
throws IOException
Default constructor, loads properties from file.
drawPage
public void drawPage(Graphics g,
PDPage p,
Dimension pageDimension)
throws IOException
This will draw the page to the requested context.
g
- The graphics context to draw onto.p
- The page to draw.pageDimension
- The size of the page to draw.
fixY
public double fixY(double x,
double y)
Fix the y coordinate based on page rotation.
x
- The x coordinate.y
- The y coordinate.
- The updated y coordinate.
getGraphics
public Graphics2D getGraphics()
Get the graphics that we are currently drawing on.
- The graphics we are drawing on.
getLinePath
public GeneralPath getLinePath()
Get the current line path to be drawn.
- The current line path to be drawn.
getLineSubPaths
public List getLineSubPaths()
Get the current list of line paths to be drawn.
- The current list of line paths to be drawn.
getNonStrokingColor
public Color getNonStrokingColor()
Get the non stroking color.
getPage
public PDPage getPage()
Get the page that is currently being drawn.
- The page that is being drawn.
getPageSize
public Dimension getPageSize()
Get the size of the page that is currently being drawn.
- The size of the page that is being drawn.
getStrokingColor
public Color getStrokingColor()
Get the stroking color.
setLinePath
public void setLinePath(GeneralPath newLinePath)
Set the line path to draw.
newLinePath
- Set the line path to draw.
setLineSubPaths
public void setLineSubPaths(List newLineSubPaths)
Set the list of line paths to draw.
newLineSubPaths
- Set the list of line paths to draw.
setNonStrokingColor
public void setNonStrokingColor(Color newNonStrokingColor)
Set the non stroking color.
newNonStrokingColor
- The non stroking color.
setStrokingColor
public void setStrokingColor(Color newStrokingColor)
Set the stroking color.
newStrokingColor
- The stroking color.
showCharacter
protected void showCharacter(TextPosition text)
You should override this method if you want to perform an action when a
string is being shown.
- showCharacter in interface PDFStreamEngine
text
- The string to display.