public class PDFStreamEngine
extends java.lang.Object
| Constructor and Description |
|---|
PDFStreamEngine()
Constructor.
|
PDFStreamEngine(java.util.Properties properties)
Constructor with engine properties.
|
| Modifier and Type | Method and Description |
|---|---|
java.util.Map<java.lang.String,PDColorSpace> |
getColorSpaces() |
PDPage |
getCurrentPage()
Get the current page that is being processed.
|
java.util.Map<java.lang.String,PDFont> |
getFonts() |
java.util.Stack<PDGraphicsState> |
getGraphicsStack() |
PDGraphicsState |
getGraphicsState() |
java.util.Map<java.lang.String,PDExtendedGraphicsState> |
getGraphicsStates() |
PDResources |
getResources() |
Matrix |
getTextLineMatrix() |
Matrix |
getTextMatrix() |
int |
getTotalCharCnt()
Get the total number of characters in the doc
(including ones that could not be mapped).
|
int |
getValidCharCnt()
Get the total number of valid characters in the doc
that could be decoded in processEncodedText().
|
java.util.Map<java.lang.String,PDXObject> |
getXObjects() |
protected java.lang.String |
inspectFontEncoding(java.lang.String str)
A method provided as an event interface to allow a subclass to perform
some specific functionality on the string encoded by a glyph.
|
boolean |
isForceParsing()
Indicates if force parsing is activated.
|
void |
processEncodedText(byte[] string)
Process encoded text from the PDF Stream.
|
protected void |
processOperator(PDFOperator operator,
java.util.List<COSBase> arguments)
This is used to handle an operation.
|
void |
processOperator(java.lang.String operation,
java.util.List<COSBase> 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.
|
protected void |
processTextPosition(TextPosition text)
A method provided as an event interface to allow a subclass to perform
some specific functionality when text needs to be processed.
|
void |
registerOperatorProcessor(java.lang.String operator,
OperatorProcessor op)
Register a custom operator processor with the engine.
|
void |
resetEngine()
This method must be called between processing documents.
|
void |
setColorSpaces(java.util.Map<java.lang.String,PDColorSpace> value) |
void |
setFonts(java.util.Map<java.lang.String,PDFont> value) |
void |
setForceParsing(boolean forceParsingValue)
Enable/Disable force parsing.
|
void |
setGraphicsStack(java.util.Stack<PDGraphicsState> value) |
void |
setGraphicsState(PDGraphicsState value) |
void |
setGraphicsStates(java.util.Map<java.lang.String,PDExtendedGraphicsState> value) |
void |
setTextLineMatrix(Matrix value) |
void |
setTextMatrix(Matrix value) |
public PDFStreamEngine()
public PDFStreamEngine(java.util.Properties properties)
throws java.io.IOException
properties - The engine properties.java.io.IOException - If there is an error setting the engine properties.public boolean isForceParsing()
public void setForceParsing(boolean forceParsingValue)
forceParsingValue - true activates force parsingpublic void registerOperatorProcessor(java.lang.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 java.io.IOException
aPage - The page.resources - The location to retrieve resources.cosStream - the Stream to execute.java.io.IOException - if there is an error accessing the stream.public void processSubStream(PDPage aPage, PDResources resources, COSStream cosStream) throws java.io.IOException
aPage - The page used for drawing.resources - The resources used when processing the stream.cosStream - The stream to process.java.io.IOException - If there is an exception while processing the stream.protected void processTextPosition(TextPosition text)
text - The text to be processed.protected java.lang.String inspectFontEncoding(java.lang.String str)
str - The string to be processed.public void processEncodedText(byte[] string)
throws java.io.IOException
string - The encoded textjava.io.IOException - If there is an error processing the stringpublic void processOperator(java.lang.String operation,
java.util.List<COSBase> arguments)
throws java.io.IOException
operation - The operation to perform.arguments - The list of arguments.java.io.IOException - If there is an error processing the operation.protected void processOperator(PDFOperator operator, java.util.List<COSBase> arguments) throws java.io.IOException
operator - The operation to perform.arguments - The list of arguments.java.io.IOException - If there is an error processing the operation.public java.util.Map<java.lang.String,PDColorSpace> getColorSpaces()
public java.util.Map<java.lang.String,PDXObject> getXObjects()
public void setColorSpaces(java.util.Map<java.lang.String,PDColorSpace> value)
value - The colorSpaces to set.public java.util.Map<java.lang.String,PDFont> getFonts()
public void setFonts(java.util.Map<java.lang.String,PDFont> value)
value - The fonts to set.public java.util.Stack<PDGraphicsState> getGraphicsStack()
public void setGraphicsStack(java.util.Stack<PDGraphicsState> value)
value - The graphicsStack to set.public PDGraphicsState getGraphicsState()
public void setGraphicsState(PDGraphicsState value)
value - The graphicsState to set.public java.util.Map<java.lang.String,PDExtendedGraphicsState> getGraphicsStates()
public void setGraphicsStates(java.util.Map<java.lang.String,PDExtendedGraphicsState> 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()
public int getValidCharCnt()
public int getTotalCharCnt()