Package org.openpdf.text.pdf.parser
Class PdfContentStreamHandler
java.lang.Object
org.openpdf.text.pdf.parser.PdfContentStreamHandler
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static classA content operator implementation (BMC).private static classA content operator implementation (BDC).(package private) static classA content operator implementation (BT).private classprivate static classA content operator implementation (EMC).(package private) static classA content operator implementation (ET).(package private) static classA content operator implementation (cm).(package private) static classA content operator implementation (').(package private) static classA content operator implementation (").(package private) static classA content operator implementation (Q).(package private) static classA content operator implementation (gs).(package private) static classA content operator implementation (q).(package private) static classA content operator implementation (Tc).(package private) static classA content operator implementation (Tf).(package private) static classA content operator implementation (Tz).(package private) static classA content operator implementation (TL).(package private) static classA content operator implementation (Tr).(package private) static classA content operator implementation (Ts).(package private) static classA content operator implementation (Tw).(package private) static classA content operator implementation (Tj).(package private) static classA content operator implementation (TJ).(package private) static classA content operator implementation (T*).(package private) static classA content operator implementation (Td).(package private) static classA content operator implementation (TD).(package private) static classA content operator implementation (Tm). -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Stack<GraphicsState>Stack keeping track of the graphics state.private Map<String,ContentOperator> A map with all supported operators operators (PDF syntax).private final TextAssemblerdetail parser for text within a marked section.private List<TextAssemblyBuffer>private final Stack<List<TextAssemblyBuffer>>private MatrixText line matrix.private MatrixText matrix. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) voidapplyTextAdjust(float tj) Adjusts the text matrix for the specified adjustment value (see TJ operator in the PDF spec for information)(package private) voiddisplayPdfString(PdfString string) Displays text.protected MatrixReturns the current line matrix.protected MatrixReturns the current text matrix.private static Matrix(package private) GraphicsStateReturns the current graphics state.protected voidLoads all the supported graphics and text state operators in a map.voidinvokeOperator(PdfLiteral operator, List<PdfObject> operands, PdfDictionary resources) Invokes an operator.lookupOperator(String operatorName) Get the operator to process a command with a given name(package private) void(package private) voidpushContext(String newContextName) voidregisterContentOperator(ContentOperator operator) Registers a content operator that will be called when the specified operator string is encountered during content processing.voidreset()
-
Field Details
-
textFragmentStreams
-
contextNames
-
renderListener
detail parser for text within a marked section. used by TextAssembler -
operators
A map with all supported operators operators (PDF syntax). -
gsStack
Stack keeping track of the graphics state. -
textMatrix
Text matrix. -
textLineMatrix
Text line matrix. -
textFragments
-
-
Constructor Details
-
PdfContentStreamHandler
-
-
Method Details
-
getMatrix
-
registerContentOperator
Registers a content operator that will be called when the specified operator string is encountered during content processing. Each operator may be registered only once (it is not legal to have multiple operators with the same operatorString)- Parameters:
operator- the operator that will receive notification when the operator is encountered- Since:
- 2.1.7
-
installDefaultOperators
protected void installDefaultOperators()Loads all the supported graphics and text state operators in a map. -
lookupOperator
Get the operator to process a command with a given name- Parameters:
operatorName- name of the operator that we might need to call- Returns:
- the operator or null if none present
-
invokeOperator
Invokes an operator.- Parameters:
operator- the PDF Syntax of the operatoroperands- a list with operandsresources- Pdf Resources found in the file containing the stream.
-
popContext
void popContext() -
pushContext
-
graphicsState
GraphicsState graphicsState()Returns the current graphics state.- Returns:
- the graphics state
-
reset
public void reset() -
getCurrentTextMatrix
Returns the current text matrix.- Returns:
- the text matrix
- Since:
- 2.1.5
-
getCurrentTextLineMatrix
Returns the current line matrix.- Returns:
- the line matrix
- Since:
- 2.1.5
-
applyTextAdjust
void applyTextAdjust(float tj) Adjusts the text matrix for the specified adjustment value (see TJ operator in the PDF spec for information)- Parameters:
tj- the text adjustment
-
getCurrentFont
- Returns:
- current font in processing state
-
displayPdfString
Displays text.- Parameters:
string- the text to display
-
getResultantText
- Returns:
- result text
-