Top Constructors Methods
org.apache.pdfbox.preflight.process

public Class AcroFormValidationProcess

extends AbstractProcess
Class Inheritance
Imports
java.io.IOException, java.util.List, org.apache.pdfbox.cos.COSBase, .COSName, org.apache.pdfbox.pdmodel.PDDocumentCatalog, org.apache.pdfbox.pdmodel.interactive.action.PDFormFieldAdditionalActions, org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotationWidget, org.apache.pdfbox.pdmodel.interactive.form.PDAcroForm, .PDField, .PDNonTerminalField, .PDTerminalField, org.apache.pdfbox.preflight.PreflightContext, .ValidationResult.ValidationError, org.apache.pdfbox.preflight.exception.ValidationException, org.apache.pdfbox.preflight.utils.ContextHelper

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected void
checkNeedAppearences(PreflightContext
the preflight context.
ctx
,
PDAcroForm
the AcroForm.
acroForm
)

This method checks if the NeedAppearances entry is present.

protected boolean

Returns:

the result of the validation.
exploreFields
(PreflightContext
the preflight context.
ctx
,
List<PDField>
the list of fields, never null.
fields
)

This function explores all fields and their children to validate them.

protected boolean

Returns:

the result of the validation.
exploreWidgets
(PreflightContext
the preflight context.
ctx
,
List<PDAnnotationWidget>
the list of widgets
widgets
)

This function explores all fields and their children to validate them.

public void
protected boolean

Returns:

the result of the check for A or AA entries.
validateField
(PreflightContext
the preflight context.
ctx
,
PDField
an acro forms field.
field
)

A and AA field are forbidden, this method checks if they are present and checks all children of this field.

Inherited from org.apache.pdfbox.preflight.process.AbstractProcess:
addFontErroraddValidationErroraddValidationErrors

Constructor Detail

AcroFormValidationProcessback to summary
public AcroFormValidationProcess()

Method Detail

checkNeedAppearencesback to summary
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:PreflightContext

the preflight context.

acroForm:PDAcroForm

the AcroForm.

exploreFieldsback to summary
protected boolean exploreFields(PreflightContext ctx, List<PDField> fields) throws IOException

This function explores all fields and their children to validate them.

Parameters
ctx:PreflightContext

the preflight context.

fields:List<PDField>

the list of fields, never null.

Returns:boolean

the result of the validation.

See Also
validateField(PreflightContext, PDField)
exploreWidgetsback to summary
protected boolean exploreWidgets(PreflightContext ctx, List<PDAnnotationWidget> widgets) throws IOException

This function explores all fields and their children to validate them.

Parameters
ctx:PreflightContext

the preflight context.

widgets:List<PDAnnotationWidget>

the list of widgets

Returns:boolean

the result of the validation.

See Also
validateField(PreflightContext, PDField)
validateback to summary
public void validate(PreflightContext ctx) throws ValidationException

Implements org.apache.pdfbox.preflight.process.ValidationProcess.validate.

Annotations
@Override
validateFieldback to summary
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:PreflightContext

the preflight context.

field:PDField

an acro forms field.

Returns:boolean

the result of the check for A or AA entries.