org.pdfbox.pdfviewer
Class PageDrawer

java.lang.Object
  extended byorg.pdfbox.util.PDFStreamEngine
      extended byorg.pdfbox.pdfviewer.PageDrawer

public class PageDrawer
extends PDFStreamEngine

This will paint a page in a PDF document to a graphics context.

Version:
$Revision: 1.15 $
Author:
Ben Litchfield (ben@benlitchfield.com)

Constructor Summary
PageDrawer()
          Default constructor, loads properties from file.
 
Method Summary
 void drawPage(Graphics g, PDPage p, Dimension pageDimension)
          This will draw the page to the requested context.
protected  void processOperator(PDFOperator operator, List arguments)
          This is used to handle an operation.
protected  void showCharacter(TextPosition text)
          You should override this method if you want to perform an action when a string is being shown.
 
Methods inherited from class org.pdfbox.util.PDFStreamEngine
getColorSpaces, getFonts, getGraphicsStack, getGraphicsState, getGraphicsStates, getResources, getTextLineMatrix, getTextMatrix, processOperator, processStream, processSubStream, setColorSpaces, setFonts, setGraphicsStack, setGraphicsState, setGraphicsStates, setTextLineMatrix, setTextMatrix, showString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PageDrawer

public PageDrawer()
           throws IOException
Default constructor, loads properties from file.

Throws:
IOException - If there is an error loading properties from the file.
Method Detail

drawPage

public void drawPage(Graphics g,
                     PDPage p,
                     Dimension pageDimension)
              throws IOException
This will draw the page to the requested context.

Parameters:
g - The graphics context to draw onto.
p - The page to draw.
pageDimension - The size of the page to draw.
Throws:
IOException - If there is an IO error while drawing the page.

showCharacter

protected void showCharacter(TextPosition text)
You should override this method if you want to perform an action when a string is being shown.

Overrides:
showCharacter in class PDFStreamEngine
Parameters:
text - The string to display.

processOperator

protected void processOperator(PDFOperator operator,
                               List arguments)
                        throws IOException
This is used to handle an operation.

Overrides:
processOperator in class PDFStreamEngine
Parameters:
operator - The operation to perform.
arguments - The list of arguments.
Throws:
IOException - If there is an error processing the operation.