Class PdfCanvasCsConverter
java.lang.Object
com.itextpdf.kernel.pdf.canvas.parser.PdfCanvasProcessor
com.itextpdf.pdfoptimizer.handlers.converters.PdfCanvasCsConverter
public class PdfCanvasCsConverter extends com.itextpdf.kernel.pdf.canvas.parser.PdfCanvasProcessor
Processor for converting PDF content stream color space.
-
Nested Class Summary
Nested classes/interfaces inherited from class com.itextpdf.kernel.pdf.canvas.parser.PdfCanvasProcessor
com.itextpdf.kernel.pdf.canvas.parser.PdfCanvasProcessor.PopGraphicsStateOperator
-
Field Summary
Fields inherited from class com.itextpdf.kernel.pdf.canvas.parser.PdfCanvasProcessor
clippingRule, currentPath, DEFAULT_OPERATOR, eventListener, isClip, supportedEvents
-
Constructor Summary
ConstructorDescriptionPdfCanvasCsConverter
(com.itextpdf.kernel.pdf.PdfDocument document, AbstractCsConverter csConverter, OptimizationSession session) Instantiates a newPdfCanvasCsConverter
instance based on PDF document and color space converter. -
Method Summary
Modifier and TypeMethodDescriptioncom.itextpdf.kernel.pdf.canvas.PdfCanvas
Gets resulting PDF canvas.protected void
invokeOperator
(com.itextpdf.kernel.pdf.PdfLiteral operator, List operands) Process PDF content stream operators.Methods inherited from class com.itextpdf.kernel.pdf.canvas.parser.PdfCanvasProcessor
beginMarkedContent, endMarkedContent, eventOccurred, getEventListener, getFont, getGraphicsState, getRegisteredOperatorStrings, getResources, getXObjectStream, paintPath, populateOperators, populateXObjectDoHandlers, processContent, processPageContent, registerContentOperator, registerXObjectDoHandler, reset
-
Constructor Details
-
PdfCanvasCsConverter
public PdfCanvasCsConverter(com.itextpdf.kernel.pdf.PdfDocument document, AbstractCsConverter csConverter, OptimizationSession session) Instantiates a newPdfCanvasCsConverter
instance based on PDF document and color space converter.- Parameters:
-
document
- the document that the resulting content stream will be written to -
csConverter
- the color space converter instance -
session
- is an auxiliary object used to support share data between stages of optimization process
-
-
Method Details
-
getCanvas
public com.itextpdf.kernel.pdf.canvas.PdfCanvas getCanvas()Gets resulting PDF canvas.- Returns:
- the PDF canvas instance
-
invokeOperator
Process PDF content stream operators. If it is operator which define or use color space, his operands will be converted by calling theAbstractCsConverter.convertContentStreamOperands(PdfColorSpace, PdfColorSpace, String, List, OptimizationSession)
method and then written to the resulting PDF canvas, otherwise operator with operands will be immediately written to th resulting PDF canvas.- Overrides:
-
invokeOperator
in classcom.itextpdf.kernel.pdf.canvas.parser.PdfCanvasProcessor
- Parameters:
-
operator
- -
operands
-
-