|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.pdfbox.util.PDFStreamEngine
This class will run through a PDF content stream and execute certain operations and provide a callback interface for clients that want to do things with the stream. See the PDFTextStripper class for an example of how to use this class.
Constructor Summary | |
PDFStreamEngine()
Constructor. |
|
PDFStreamEngine(Properties properties)
Constructor with engine properties. |
Method Summary | |
Map |
getColorSpaces()
|
PDPage |
getCurrentPage()
Get the current page that is being processed. |
Map |
getFonts()
|
Stack |
getGraphicsStack()
|
PDGraphicsState |
getGraphicsState()
|
Map |
getGraphicsStates()
|
PDResources |
getResources()
|
Matrix |
getTextLineMatrix()
|
Matrix |
getTextMatrix()
|
Map |
getXObjects()
|
protected void |
processOperator(PDFOperator operator,
List arguments)
This is used to handle an operation. |
void |
processOperator(String operation,
List arguments)
This is used to handle an operation. |
void |
processStream(PDPage aPage,
PDResources resources,
COSStream cosStream)
This will process the contents of the stream. |
void |
processSubStream(PDPage aPage,
PDResources resources,
COSStream cosStream)
Process a sub stream of the current stream. |
void |
registerOperatorProcessor(String operator,
OperatorProcessor op)
Register a custom operator processor with the engine. |
void |
resetEngine()
This method must be called between processing documents. |
void |
setColorSpaces(Map value)
|
void |
setFonts(Map value)
|
void |
setGraphicsStack(Stack value)
|
void |
setGraphicsState(PDGraphicsState value)
|
void |
setGraphicsStates(Map value)
|
void |
setTextLineMatrix(Matrix value)
|
void |
setTextMatrix(Matrix value)
|
protected void |
showCharacter(TextPosition text)
A method provided as an event interface to allow a subclass to perform some specific functionality when a character needs to be displayed. |
void |
showString(byte[] string)
You should override this method if you want to perform an action when a string is being shown. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public PDFStreamEngine()
public PDFStreamEngine(Properties properties) throws IOException
properties
- The engine properties.
IOException
- If there is an error setting the engine properties.Method Detail |
public void registerOperatorProcessor(String operator, OperatorProcessor op)
operator
- The operator as a string.op
- Processor instance.public void resetEngine()
public void processStream(PDPage aPage, PDResources resources, COSStream cosStream) throws IOException
aPage
- The page.resources
- The location to retrieve resources.cosStream
- the Stream to execute.
IOException
- if there is an error accessing the stream.public void processSubStream(PDPage aPage, PDResources resources, COSStream cosStream) throws IOException
aPage
- The page used for drawing.resources
- The resources used when processing the stream.cosStream
- The stream to process.
IOException
- If there is an exception while processing the stream.protected void showCharacter(TextPosition text)
text
- The character to be displayed.public void showString(byte[] string) throws IOException
string
- The string to display.
IOException
- If there is an error showing the stringpublic void processOperator(String operation, List arguments) throws IOException
operation
- The operation to perform.arguments
- The list of arguments.
IOException
- If there is an error processing the operation.protected void processOperator(PDFOperator operator, List arguments) throws IOException
operator
- The operation to perform.arguments
- The list of arguments.
IOException
- If there is an error processing the operation.public Map getColorSpaces()
public Map getXObjects()
public void setColorSpaces(Map value)
value
- The colorSpaces to set.public Map getFonts()
public void setFonts(Map value)
value
- The fonts to set.public Stack getGraphicsStack()
public void setGraphicsStack(Stack value)
value
- The graphicsStack to set.public PDGraphicsState getGraphicsState()
public void setGraphicsState(PDGraphicsState value)
value
- The graphicsState to set.public Map getGraphicsStates()
public void setGraphicsStates(Map value)
value
- The graphicsStates to set.public Matrix getTextLineMatrix()
public void setTextLineMatrix(Matrix value)
value
- The textLineMatrix to set.public Matrix getTextMatrix()
public void setTextMatrix(Matrix value)
value
- The textMatrix to set.public PDResources getResources()
public PDPage getCurrentPage()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |