Class PreflightContentStream


public class PreflightContentStream extends PreflightStreamEngine
  • Constructor Details

  • Method Details

    • validatePageContentStream

      public void validatePageContentStream() throws ValidationException
      Process 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, List<COSBase> operands) throws IOException
      Description copied from class: PDFStreamEngine
      This is used to handle an operation.
      Overrides:
      processOperator in class PDFStreamEngine
      Parameters:
      operator - The operation to perform.
      operands - The list of arguments.
      Throws:
      IOException - If there is an error processing the operation.
    • unsupportedOperator

      protected void unsupportedOperator(Operator operator, List<COSBase> arguments)
      Description copied from class: PDFStreamEngine
      Called when an unsupported operator is encountered.
      Overrides:
      unsupportedOperator in class PDFStreamEngine
      Parameters:
      operator - The unknown operator.
      arguments - The list of operands.
    • checkShowTextOperators

      protected void checkShowTextOperators(Operator operator, List<?> arguments) throws IOException
      Process Text Validation. Depending on the operator parameter, this will either call validateStringDefinition or validateStringArray.
      Parameters:
      operator -
      arguments -
      Throws:
      IOException
    • validateStringDefinition

      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)
      Parameters:
      operator -
      arguments -
      Throws:
      IOException
    • validateStringArray

      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)
      Parameters:
      operator -
      arguments -
      Throws:
      IOException
    • validateText

      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.
      Parameters:
      string -
      Throws:
      IOException