public class PdfContentStreamProcessor extends Object
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULTOPERATOR
Default operator
|
Constructor and Description |
---|
PdfContentStreamProcessor(RenderListener renderListener)
Creates a new PDF Content Stream Processor that will send it's output to the designated render listener.
|
Modifier and Type | Method and Description |
---|---|
Collection<String> |
getRegisteredOperatorStrings() |
RenderListener |
getRenderListener()
Accessor method for the RenderListener object maintained in this class.
|
GraphicsState |
gs()
Returns the current graphics state.
|
protected void |
handleInlineImage(InlineImageInfo info, PdfDictionary colorSpaceDic)
Callback when an inline image is found.
|
void |
processContent(byte[] contentBytes, PdfDictionary resources)
Processes PDF syntax.
|
ContentOperator |
registerContentOperator(String operatorString, ContentOperator operator)
Registers a content operator that will be called when the specified operator string is encountered during content processing.
|
XObjectDoHandler |
registerXObjectDoHandler(PdfName xobjectSubType, XObjectDoHandler handler)
Registers a Do handler that will be called when Do for the provided XObject subtype is encountered during content processing.
|
void |
reset()
Resets the graphics state stack, matrices and resources.
|
public static final String DEFAULTOPERATOR
public PdfContentStreamProcessor(RenderListener renderListener)
renderListener
- the RenderListener
that will receive rendering notifications
public XObjectDoHandler registerXObjectDoHandler(PdfName xobjectSubType, XObjectDoHandler handler)
xobjectSubType
- the XObject subtype this handler will process, or PdfName.DEFAULT for a catch-all handler
handler
- the handler that will receive notification when the Do operator for the specified subtype is encountered
public ContentOperator registerContentOperator(String operatorString, ContentOperator operator)
operatorString
- the operator id, or DEFAULTOPERATOR for a catch-all operator
operator
- the operator that will receive notification when the operator is encountered
public Collection<String> getRegisteredOperatorStrings()
Collection
containing all the registered operators strings
public void reset()
public GraphicsState gs()
public void processContent(byte[] contentBytes, PdfDictionary resources)
PdfContentStreamProcessor
, you must call reset()
contentBytes
- the bytes of a content stream
resources
- the resources that come with the content stream
protected void handleInlineImage(InlineImageInfo info, PdfDictionary colorSpaceDic)
info
- the inline image
colorSpaceDic
- the color space for the inline immage
public RenderListener getRenderListener()
Copyright © 1998–2016. All rights reserved.