public abstract class PreflightStreamEngine extends PDFStreamEngine
Modifier and Type | Class and Description |
---|---|
private static class |
PreflightStreamEngine.ColorSpaceType |
Modifier and Type | Field and Description |
---|---|
protected PreflightContext |
context |
protected COSDocument |
cosDocument |
protected PDPage |
processedPage |
Constructor and Description |
---|
PreflightStreamEngine(PreflightContext context,
PDPage page) |
Modifier and Type | Method and Description |
---|---|
protected void |
checkColorOperators(java.lang.String operation)
This method validates if the ColorOperator can be used with the color space
defined in OutputIntent dictionaries.
|
protected void |
checkSetColorSpaceOperators(Operator operator,
java.util.List<COSBase> arguments)
This method validates if the ColorSpace used as operand is consistent with
the color space defined in OutputIntent dictionaries.
|
private PDColorSpace |
getColorSpace(java.lang.String operation) |
private ColorSpaceHelper |
getColorSpaceHelper(PDColorSpace pdCS) |
private boolean |
isDeviceIndependent(PDColorSpace cs,
PreflightStreamEngine.ColorSpaceType expectedIccType) |
protected void |
registerError(java.lang.String msg,
java.lang.String errorCode)
Add a validation error into the PreflightContext
|
protected void |
registerError(java.lang.String msg,
java.lang.String errorCode,
boolean warning) |
void |
registerError(java.lang.String msg,
java.lang.String errorCode,
boolean warning,
java.lang.Throwable cause) |
void |
registerError(java.lang.String msg,
java.lang.String errorCode,
java.lang.Throwable cause) |
private COSBase |
toLongName(COSBase cs) |
(package private) void |
validateDefaultColorSpace(Operator operator)
In some cases, the colorspace isn't checked because defaults (/DeviceGray) is used.
|
protected void |
validateInlineImageColorSpace(Operator operator)
This method validates if the ColorSpace used by the InlinedImage is consistent with
the color space defined in OutputIntent dictionaries.
|
protected void |
validateInlineImageFilter(Operator operator)
Throw a ContentStreamException if the LZW filter is used in a InlinedImage.
|
protected void |
validateNumberOfGraphicStates(Operator operator)
Valid the number of graphic states if the operator is the Save Graphic state operator ("q")
|
protected void |
validateRenderingIntent(Operator operator,
java.util.List<COSBase> arguments)
Check operands of the "ri" operator.
|
private boolean |
validColorSpace(PDColorSpace colorSpace,
PreflightStreamEngine.ColorSpaceType expectedIccType) |
private boolean |
validColorSpaceDestOutputProfile(PreflightStreamEngine.ColorSpaceType expectedType) |
addOperator, applyTextAdjustment, beginMarkedContentSequence, beginText, decreaseLevel, endMarkedContentSequence, endText, getAppearance, getCurrentPage, getGraphicsStackSize, getGraphicsState, getInitialMatrix, getLevel, getResources, getTextLineMatrix, getTextMatrix, increaseLevel, operatorException, processAnnotation, processChildStream, processOperator, processOperator, processPage, processSoftMask, processTilingPattern, processTilingPattern, processTransparencyGroup, processType3Stream, registerOperatorProcessor, restoreGraphicsStack, restoreGraphicsState, saveGraphicsStack, saveGraphicsState, setLineDashPattern, setTextLineMatrix, setTextMatrix, showAnnotation, showFontGlyph, showForm, showGlyph, showText, showTextString, showTextStrings, showTransparencyGroup, showType3Glyph, transformedPoint, transformWidth, unsupportedOperator
protected PreflightContext context
protected COSDocument cosDocument
protected PDPage processedPage
public PreflightStreamEngine(PreflightContext context, PDPage page)
protected void validateRenderingIntent(Operator operator, java.util.List<COSBase> arguments) throws ContentStreamException
operator
- the "ri" operatorarguments
- the "ri" operandsContentStreamException
- ERROR_GRAPHIC_UNEXPECTED_VALUE_FOR_KEY if the operand is invalidprotected void validateNumberOfGraphicStates(Operator operator) throws ContentStreamException
operator
- ContentStreamException
protected void validateInlineImageFilter(Operator operator) throws ContentStreamException
operator
- the InlinedImage object (BI to EI)ContentStreamException
protected void validateInlineImageColorSpace(Operator operator) throws java.io.IOException
operator
- the InlinedImage object (BI to EI)java.io.IOException
private ColorSpaceHelper getColorSpaceHelper(PDColorSpace pdCS)
protected void checkColorOperators(java.lang.String operation) throws ContentStreamException
operation
- the color operatorContentStreamException
void validateDefaultColorSpace(Operator operator) throws ContentStreamException
operator
- an operator.ContentStreamException
private boolean validColorSpace(PDColorSpace colorSpace, PreflightStreamEngine.ColorSpaceType expectedIccType) throws ContentStreamException
ContentStreamException
private boolean validColorSpaceDestOutputProfile(PreflightStreamEngine.ColorSpaceType expectedType) throws ContentStreamException
ContentStreamException
private boolean isDeviceIndependent(PDColorSpace cs, PreflightStreamEngine.ColorSpaceType expectedIccType)
private PDColorSpace getColorSpace(java.lang.String operation)
protected void checkSetColorSpaceOperators(Operator operator, java.util.List<COSBase> arguments) throws java.io.IOException
operator
- arguments
- java.io.IOException
protected void registerError(java.lang.String msg, java.lang.String errorCode)
msg
- exception detailserrorCode
- the error code.public void registerError(java.lang.String msg, java.lang.String errorCode, java.lang.Throwable cause)
protected void registerError(java.lang.String msg, java.lang.String errorCode, boolean warning)
public void registerError(java.lang.String msg, java.lang.String errorCode, boolean warning, java.lang.Throwable cause)