Class AcroFormValidationProcess

java.lang.Object
org.apache.pdfbox.preflight.process.AbstractProcess
org.apache.pdfbox.preflight.process.AcroFormValidationProcess
All Implemented Interfaces:
ValidationProcess

public class AcroFormValidationProcess extends AbstractProcess
  • Constructor Details

    • AcroFormValidationProcess

      public AcroFormValidationProcess()
  • Method Details

    • validate

      public void validate(PreflightContext ctx) throws ValidationException
      Throws:
      ValidationException
    • checkNeedAppearences

      protected void checkNeedAppearences(PreflightContext ctx, PDAcroForm acroForm)
      This method checks if the NeedAppearances entry is present. If it is, the value must be false. If the entry is invalid, the ERROR_SYNTAX_DICT_INVALID (1.2.3) error is return.
      Parameters:
      ctx - the preflight context.
      acroForm - the AcroForm.
    • exploreFields

      protected boolean exploreFields(PreflightContext ctx, List<PDField> fields) throws IOException
      This function explores all fields and their children to validate them.
      Parameters:
      ctx - the preflight context.
      fields - the list of fields, can be null (this will no longer be allowed in 3.0, and it isn't null currently unless methods are extended).
      Returns:
      the result of the validation.
      Throws:
      IOException
      See Also:
    • exploreWidgets

      protected boolean exploreWidgets(PreflightContext ctx, List<PDAnnotationWidget> widgets) throws IOException
      This function explores all fields and their children to validate them.
      Parameters:
      ctx - the preflight context.
      widgets - the list of widgets
      Returns:
      the result of the validation.
      Throws:
      IOException
      See Also:
    • validateField

      protected boolean validateField(PreflightContext ctx, PDField field) throws IOException
      A and AA field are forbidden, this method checks if they are present and checks all children of this field. If the an Additional Action is present the error code ERROR_ACTION_FORBIDDEN_ADDITIONAL_ACTIONS_FIELD (6.2.3) is added to the error list If the an Action is present (in the Widget Annotation) the error ERROR_ACTION_FORBIDDEN_WIDGET_ACTION_FIELD (6.2.4) is added to the error list. (Remark : The widget validation will be done by the AnnotationValidationHelper, but some actions are authorized in a standard Widget)
      Parameters:
      ctx - the preflight context.
      field - an acro forms field.
      Returns:
      the result of the check for A or AA entries.
      Throws:
      IOException