Package com.lowagie.text.pdf.parser
Class PdfContentStreamProcessor
java.lang.Object
com.lowagie.text.pdf.parser.PdfContentStreamProcessor
- Direct Known Subclasses:
SimpleTextExtractingPdfContentStreamProcessor
Processor for a PDF content Stream.
- Since:
- 2.1.4
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddisplayPdfString(PdfString string, float tj) Displays text.abstract voiddisplayText(String text, Matrix nextTextMatrix) Displays text.Returns the current line matrix.Returns the current text matrix.floatgetStringWidth(String string, float tj) Gets the width of a String.gs()Returns the current graphics state.voidinvokeOperator(PdfLiteral operator, ArrayList operands) Invokes an operator.voidprocessContent(byte[] contentBytes, PdfDictionary resources) Processes PDF syntaxvoidregisterContentOperator(String operatorString, ContentOperator operator) Registers a content operator that will be called when the specified operator string is encountered during content processing.voidreset()Resets the graphics state stack, matrices and resources.
-
Constructor Details
-
PdfContentStreamProcessor
public PdfContentStreamProcessor()Creates a new PDF Content Stream Processor.
-
-
Method Details
-
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:
operatorString- the operator idoperator- the operator that will receive notification when the operator is encountered- Since:
- 2.1.8
-
reset
public void reset()Resets the graphics state stack, matrices and resources. -
gs
Returns the current graphics state.- Returns:
- the graphics state
-
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
-
invokeOperator
Invokes an operator.- Parameters:
operator- the PDF Syntax of the operatoroperands- a list with operands
-
displayText
Displays text.- Parameters:
text- the text that needs to be displayednextTextMatrix- a text matrix
-
getStringWidth
Gets the width of a String.- Parameters:
string- the string that needs measuringtj- text adjustment- Returns:
- the width of a String
-
displayPdfString
Displays text.- Parameters:
string- the text to displaytj- the text adjustment
-
processContent
Processes PDF syntax- Parameters:
contentBytes- the bytes of a content streamresources- the resources that come with the content stream
-