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 Summary
Constructors Constructor Description AcroFormValidationProcess()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
checkNeedAppearences(PreflightContext ctx, PDAcroForm acroForm)
This method checks if the NeedAppearances entry is present.protected boolean
exploreFields(PreflightContext ctx, java.util.List<PDField> lFields)
This function explores all fields and their children to validate them.protected boolean
exploreWidgets(PreflightContext ctx, java.util.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
-
-
-
-
Method Detail
-
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, java.util.List<PDField> lFields) throws java.io.IOException
This function explores all fields and their children to validate them.- Parameters:
ctx
- the preflight context.lFields
- the list of fields, can be null.- Returns:
- the result of the validation.
- Throws:
java.io.IOException
- See Also:
validateField(PreflightContext, PDField)
-
exploreWidgets
protected boolean exploreWidgets(PreflightContext ctx, java.util.List<PDAnnotationWidget> widgets) throws java.io.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:
java.io.IOException
- See Also:
validateField(PreflightContext, PDField)
-
validateField
protected boolean validateField(PreflightContext ctx, PDField field) throws java.io.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:
java.io.IOException
-
-