Class PreflightContentStream
- java.lang.Object
-
- org.apache.pdfbox.contentstream.PDFStreamEngine
-
- org.apache.pdfbox.preflight.content.PreflightStreamEngine
-
- org.apache.pdfbox.preflight.content.PreflightContentStream
-
public class PreflightContentStream extends PreflightStreamEngine
-
-
Field Summary
-
Fields inherited from class org.apache.pdfbox.preflight.content.PreflightStreamEngine
context, processedPage
-
-
Constructor Summary
Constructors Constructor Description PreflightContentStream(PreflightContext _context, PDPage _page)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcheckShowTextOperators(Operator operator, java.util.List<?> arguments)Process Text Validation.protected voidprocessOperator(Operator operator, java.util.List<COSBase> operands)This is used to handle an operation.protected voidunsupportedOperator(Operator operator, java.util.List<COSBase> arguments)Called when an unsupported operator is encountered.voidvalidatePageContentStream()Process the validation of a PageContent (The page is initialized by the constructor)voidvalidatePatternContentStream(PDTilingPattern pattern)Process the validation of a Tiling Patternprivate voidvalidateStringArray(Operator operator, java.util.List<?> arguments)Process Text Validation for the Operands of a TJ operator.private voidvalidateStringDefinition(Operator operator, java.util.List<?> arguments)Process Text Validation for the Operands of a Tj, "'" and "\"" operator.voidvalidateText(byte[] string)Process the validation of a Text operand contains in a ContentStream This validation checks that : The font isn't missing if the Rendering Mode isn't 3 The font metrics are consistent All character used in the text are defined in the font program.voidvalidateXObjContentStream(PDFormXObject form)Process the validation of a XObject Form-
Methods inherited from class org.apache.pdfbox.preflight.content.PreflightStreamEngine
checkColorOperators, checkSetColorSpaceOperators, registerError, registerError, registerError, registerError, validateDefaultColorSpace, validateInlineImageColorSpace, validateInlineImageFilter, validateNumberOfGraphicStates, validateRenderingIntent
-
Methods inherited from class org.apache.pdfbox.contentstream.PDFStreamEngine
addOperator, applyTextAdjustment, beginMarkedContentSequence, beginText, decreaseLevel, endMarkedContentSequence, endText, getAppearance, getCurrentPage, getGraphicsStackSize, getGraphicsState, getInitialMatrix, getLevel, getResources, getTextLineMatrix, getTextMatrix, increaseLevel, isShouldProcessColorOperators, markedContentPoint, operatorException, processAnnotation, processChildStream, processOperator, processPage, processSoftMask, processTilingPattern, processTilingPattern, processTransparencyGroup, processType3Stream, restoreGraphicsStack, restoreGraphicsState, saveGraphicsStack, saveGraphicsState, setLineDashPattern, setTextLineMatrix, setTextMatrix, showAnnotation, showFontGlyph, showForm, showGlyph, showText, showTextString, showTextStrings, showTransparencyGroup, showType3Glyph, transformedPoint, transformWidth
-
-
-
-
Constructor Detail
-
PreflightContentStream
public PreflightContentStream(PreflightContext _context, PDPage _page)
-
-
Method Detail
-
validatePageContentStream
public void validatePageContentStream() throws ValidationExceptionProcess the validation of a PageContent (The page is initialized by the constructor)- Throws:
ValidationException
-
validateXObjContentStream
public void validateXObjContentStream(PDFormXObject form) throws ValidationException
Process the validation of a XObject Form- Parameters:
form- the PDFormXObject to be validated.- Throws:
ValidationException
-
validatePatternContentStream
public void validatePatternContentStream(PDTilingPattern pattern) throws ValidationException
Process the validation of a Tiling Pattern- Parameters:
pattern- the PDTilingPattern to be validated.- Throws:
ValidationException
-
processOperator
protected void processOperator(Operator operator, java.util.List<COSBase> operands) throws java.io.IOException
Description copied from class:PDFStreamEngineThis is used to handle an operation.- Overrides:
processOperatorin classPDFStreamEngine- Parameters:
operator- The operation to perform.operands- The list of arguments.- Throws:
java.io.IOException- If there is an error processing the operation.
-
unsupportedOperator
protected void unsupportedOperator(Operator operator, java.util.List<COSBase> arguments)
Description copied from class:PDFStreamEngineCalled when an unsupported operator is encountered.- Overrides:
unsupportedOperatorin classPDFStreamEngine- Parameters:
operator- The unknown operator.arguments- The list of operands.
-
checkShowTextOperators
protected void checkShowTextOperators(Operator operator, java.util.List<?> arguments) throws java.io.IOException
Process Text Validation. Depending on the operator parameter, this will either callvalidateStringDefinitionorvalidateStringArray.- Parameters:
operator-arguments-- Throws:
java.io.IOException
-
validateStringDefinition
private void validateStringDefinition(Operator operator, java.util.List<?> arguments) throws java.io.IOException
Process Text Validation for the Operands of a Tj, "'" and "\"" operator. If the validation fails for an unexpected reason, a IOException is thrown. If the validation fails due to validation error, a ContentStreamException is thrown. (Use the ValidationError attribute to know the cause)- Parameters:
operator-arguments-- Throws:
java.io.IOException
-
validateStringArray
private void validateStringArray(Operator operator, java.util.List<?> arguments) throws java.io.IOException
Process Text Validation for the Operands of a TJ operator. If the validation fails for an unexpected reason, a IOException is thrown. If the validation fails due to validation error, a ContentStreamException is thrown. (Use the ValidationError attribute to know the cause)- Parameters:
operator-arguments-- Throws:
java.io.IOException
-
validateText
public void validateText(byte[] string) throws java.io.IOExceptionProcess the validation of a Text operand contains in a ContentStream This validation checks that :- The font isn't missing if the Rendering Mode isn't 3
- The font metrics are consistent
- All character used in the text are defined in the font program.
- Parameters:
string-- Throws:
java.io.IOException
-
-