Class AcroFormValidationProcess
java.lang.Object
org.apache.pdfbox.preflight.process.AbstractProcess
org.apache.pdfbox.preflight.process.AcroFormValidationProcess
- All Implemented Interfaces:
ValidationProcess
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
checkNeedAppearences
(PreflightContext ctx, PDAcroForm acroForm) This method checks if the NeedAppearances entry is present.protected boolean
exploreFields
(PreflightContext ctx, List<PDField> fields) This function explores all fields and their children to validate them.protected boolean
exploreWidgets
(PreflightContext ctx, List<PDAnnotationWidget> widgets) This function explores all fields and their children to validate them.void
validate
(PreflightContext ctx) protected boolean
validateField
(PreflightContext ctx, PDField field) A and AA field are forbidden, this method checks if they are present and checks all children of this field.Methods inherited from class org.apache.pdfbox.preflight.process.AbstractProcess
addFontError, addValidationError, addValidationErrors
-
Constructor Details
-
AcroFormValidationProcess
public AcroFormValidationProcess()
-
-
Method Details
-
validate
- Throws:
ValidationException
-
checkNeedAppearences
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
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
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
-