Top Fields Constructors Methods
org.apache.pdfbox.preflight.content

public Class PreflightContentStream

extends PreflightStreamEngine
Class Inheritance
Imports
java.io.ByteArrayInputStream, .IOException, .InputStream, java.util.List, org.apache.pdfbox.contentstream.operator.Operator, .OperatorName, org.apache.pdfbox.cos.COSArray, .COSBase, .COSFloat, .COSInteger, .COSString, org.apache.pdfbox.pdmodel.PDPage, org.apache.pdfbox.pdmodel.font.PDFont, org.apache.pdfbox.pdmodel.graphics.form.PDFormXObject, org.apache.pdfbox.pdmodel.graphics.pattern.PDTilingPattern, org.apache.pdfbox.pdmodel.graphics.state.PDTextState, .RenderingMode, org.apache.pdfbox.preflight.PreflightContext, .ValidationResult.ValidationError, org.apache.pdfbox.preflight.exception.ValidationException, org.apache.pdfbox.preflight.font.container.FontContainer, org.apache.pdfbox.preflight.font.util.GlyphException

Field Summary

Inherited from org.apache.pdfbox.preflight.content.PreflightStreamEngine:
contextprocessedPage

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected void
checkShowTextOperators(Operator operator, List<?> arguments)

Process Text Validation.

protected void
processOperator(Operator
The operation to perform.
operator
,
List<COSBase>
The list of arguments.
operands
)

Overrides org.apache.pdfbox.contentstream.PDFStreamEngine.processOperator.

This is used to handle an operation.

protected void
unsupportedOperator(Operator
The unknown operator.
operator
,
List<COSBase>
The list of operands.
arguments
)

Overrides org.apache.pdfbox.contentstream.PDFStreamEngine.unsupportedOperator.

Called when an unsupported operator is encountered.

public void
validatePageContentStream()

Process the validation of a PageContent (The page is initialized by the constructor)

public void
validatePatternContentStream(PDTilingPattern
the PDTilingPattern to be validated.
pattern
)

Process the validation of a Tiling Pattern

private void
validateStringArray(Operator operator, List<?> arguments)

Process Text Validation for the Operands of a TJ operator.

private void
validateStringDefinition(Operator operator, List<?> arguments)

Process Text Validation for the Operands of a Tj, "'" and "\"" operator.

public void
validateText(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.
public void
validateXObjContentStream(PDFormXObject
the PDFormXObject to be validated.
form
)

Process the validation of a XObject Form

Inherited from org.apache.pdfbox.preflight.content.PreflightStreamEngine:
checkColorOperatorscheckSetColorSpaceOperatorsregisterErrorregisterErrorregisterErrorregisterErrorvalidateDefaultColorSpacevalidateInlineImageColorSpacevalidateInlineImageFiltervalidateNumberOfGraphicStatesvalidateRenderingIntent

Constructor Detail

PreflightContentStreamback to summary
public PreflightContentStream(PreflightContext _context, PDPage _page)

Method Detail

checkShowTextOperatorsback to summary
protected void checkShowTextOperators(Operator operator, List<?> arguments) throws IOException

Process Text Validation. Depending on the operator parameter, this will either call validateStringDefinition or validateStringArray.

processOperatorback to summary
protected void processOperator(Operator operator, List<COSBase> operands) throws IOException

Overrides org.apache.pdfbox.contentstream.PDFStreamEngine.processOperator.

Doc from org.apache.pdfbox.contentstream.PDFStreamEngine.processOperator.

This is used to handle an operation.

Parameters
operator:Operator

The operation to perform.

operands:List<COSBase>

The list of arguments.

Annotations
@Override
Exceptions
IOException:
If there is an error processing the operation.
unsupportedOperatorback to summary
protected void unsupportedOperator(Operator operator, List<COSBase> arguments)

Overrides org.apache.pdfbox.contentstream.PDFStreamEngine.unsupportedOperator.

Doc from org.apache.pdfbox.contentstream.PDFStreamEngine.unsupportedOperator.

Called when an unsupported operator is encountered.

Parameters
operator:Operator

The unknown operator.

arguments:List<COSBase>

The list of operands.

Annotations
@Override
validatePageContentStreamback to summary
public void validatePageContentStream() throws ValidationException

Process the validation of a PageContent (The page is initialized by the constructor)

validatePatternContentStreamback to summary
public void validatePatternContentStream(PDTilingPattern pattern) throws ValidationException

Process the validation of a Tiling Pattern

Parameters
pattern:PDTilingPattern

the PDTilingPattern to be validated.

validateStringArrayback to summary
private void validateStringArray(Operator operator, List<?> arguments) throws 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)

validateStringDefinitionback to summary
private void validateStringDefinition(Operator operator, List<?> arguments) throws 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)

validateTextback to summary
public void validateText(byte[] string) throws IOException

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.
validateXObjContentStreamback to summary
public void validateXObjContentStream(PDFormXObject form) throws ValidationException

Process the validation of a XObject Form

Parameters
form:PDFormXObject

the PDFormXObject to be validated.