|
![]() |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.lowagie.text.pdf.parser.PdfContentStreamProcessor
public class PdfContentStreamProcessor
Processor for a PDF content Stream.
Nested Class Summary | |
---|---|
private static class |
PdfContentStreamProcessor.BeginText
A content operator implementation (BT). |
private static class |
PdfContentStreamProcessor.EndText
A content operator implementation (ET). |
private static class |
PdfContentStreamProcessor.ModifyCurrentTransformationMatrix
A content operator implementation (cm). |
private static class |
PdfContentStreamProcessor.MoveNextLineAndShowText
A content operator implementation ('). |
private static class |
PdfContentStreamProcessor.MoveNextLineAndShowTextWithSpacing
A content operator implementation ("). |
private static class |
PdfContentStreamProcessor.PopGraphicsState
A content operator implementation (Q). |
private static class |
PdfContentStreamProcessor.ProcessGraphicsStateResource
A content operator implementation (gs). |
private static class |
PdfContentStreamProcessor.PushGraphicsState
A content operator implementation (q). |
private static class |
PdfContentStreamProcessor.SetTextCharacterSpacing
A content operator implementation (Tc). |
private static class |
PdfContentStreamProcessor.SetTextFont
A content operator implementation (Tf). |
private static class |
PdfContentStreamProcessor.SetTextHorizontalScaling
A content operator implementation (Tz). |
private static class |
PdfContentStreamProcessor.SetTextLeading
A content operator implementation (TL). |
private static class |
PdfContentStreamProcessor.SetTextRenderMode
A content operator implementation (Tr). |
private static class |
PdfContentStreamProcessor.SetTextRise
A content operator implementation (Ts). |
private static class |
PdfContentStreamProcessor.SetTextWordSpacing
A content operator implementation (Tw). |
private static class |
PdfContentStreamProcessor.ShowText
A content operator implementation (Tj). |
private static class |
PdfContentStreamProcessor.ShowTextArray
A content operator implementation (TJ). |
private static class |
PdfContentStreamProcessor.TextMoveNextLine
A content operator implementation (T*). |
private static class |
PdfContentStreamProcessor.TextMoveStartNextLine
A content operator implementation (Td). |
private static class |
PdfContentStreamProcessor.TextMoveStartNextLineWithLeading
A content operator implementation (TD). |
private static class |
PdfContentStreamProcessor.TextSetTextMatrix
A content operator implementation (Tm). |
Field Summary | |
---|---|
private Stack |
gsStack
Stack keeping track of the graphics state. |
private Map |
operators
A map with all supported operators operators (PDF syntax). |
private RenderListener |
renderListener
A list of listeners that will be notified of render events |
private PdfDictionary |
resources
Resources for the content stream. |
private Matrix |
textLineMatrix
Text line matrix. |
private Matrix |
textMatrix
Text matrix. |
Constructor Summary | |
---|---|
PdfContentStreamProcessor(RenderListener renderListener)
Creates a new PDF Content Stream Processor that will send it's output to the designated render listener. |
Method Summary | |
---|---|
private void |
applyTextAdjust(float tj)
Adjusts the text matrix for the specified adjustment value (see TJ operator in the PDF spec for information) |
private String |
decode(PdfString in)
Decodes a PdfString (which will contain glyph ids encoded in the font's encoding) based on the active font, and determine the unicode equivalent |
private void |
displayPdfString(PdfString string)
Displays text. |
private Matrix |
getCurrentTextLineMatrix()
Returns the current line matrix. |
private Matrix |
getCurrentTextMatrix()
Returns the current text matrix. |
private GraphicsState |
gs()
Returns the current graphics state. |
private void |
invokeOperator(PdfLiteral operator,
ArrayList operands)
Invokes an operator. |
private void |
populateOperators()
Loads all the supported graphics and text state operators in a map. |
void |
processContent(byte[] contentBytes,
PdfDictionary resources)
Processes PDF syntax |
void |
registerContentOperator(String operatorString,
ContentOperator operator)
Registers a content operator that will be called when the specified operator string is encountered during content processing. |
void |
reset()
Resets the graphics state stack, matrices and resources. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private Map operators
private PdfDictionary resources
private Stack gsStack
private Matrix textMatrix
private Matrix textLineMatrix
private final RenderListener renderListener
Constructor Detail |
---|
public PdfContentStreamProcessor(RenderListener renderListener)
renderListener
- the AbstractRenderListener
that will receive rendering notificationsMethod Detail |
---|
private void populateOperators()
public void registerContentOperator(String operatorString, ContentOperator operator)
operatorString
- the operator idoperator
- the operator that will receive notification when the operator is encounteredpublic void reset()
private GraphicsState gs()
private Matrix getCurrentTextMatrix()
private Matrix getCurrentTextLineMatrix()
private void invokeOperator(PdfLiteral operator, ArrayList operands)
operator
- the PDF Syntax of the operatoroperands
- a list with operandsprivate String decode(PdfString in)
in
- the String that needs to be encoded
private void displayPdfString(PdfString string)
string
- the text to displayprivate void applyTextAdjust(float tj)
tj
- the text adjustmentpublic void processContent(byte[] contentBytes, PdfDictionary resources)
contentBytes
- the bytes of a content streamresources
- the resources that come with the content stream
|
Hosted by Hostbasket | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |