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() |
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 notificationspublic XObjectDoHandler registerXObjectDoHandler(PdfName xobjectSubType, XObjectDoHandler handler)
xobjectSubType
- the XObject subtype this handler will process, or PdfName.DEFAULT for a catch-all handlerhandler
- the handler that will receive notification when the Do operator for the specified subtype is encounteredpublic ContentOperator registerContentOperator(String operatorString, ContentOperator operator)
operatorString
- the operator id, or DEFAULTOPERATOR for a catch-all operatoroperator
- the operator that will receive notification when the operator is encounteredpublic Collection<String> getRegisteredOperatorStrings()
Collection
containing all the registered operators stringspublic void reset()
public GraphicsState gs()
public void processContent(byte[] contentBytes, PdfDictionary resources)
PdfContentStreamProcessor
, you must call reset()
contentBytes
- the bytes of a content streamresources
- the resources that come with the content streamprotected void handleInlineImage(InlineImageInfo info, PdfDictionary colorSpaceDic)
info
- the inline imagecolorSpaceDic
- the color space for the inline immageCopyright © 2019. All rights reserved.