---
Product: Aspose.PDF
Platform: java
Page Type: docs
Canonical URL: https://docs.aspose.org/pdf/java/developer-guide/rules
---

# PDF/A Validation Rules

ActionRules and AnnotationRules for PDF/A compliance validation in Aspose.PDF FOSS for Java.

## Validation Rule Classes

PDF/A compliance validation is implemented through rule classes that extend `PdfARule`.
Each rule class checks a specific aspect of the document for conformance with the
target archival format.

## ActionRules

`ActionRules` validates that action dictionaries in catalog, page, and widget entries
comply with PDF/A restrictions. JavaScript actions, named actions, and certain trigger
actions are forbidden in PDF/A documents.

```java
ActionRules rules = new ActionRules();
rules.validate(parser, format, result);
```

## AnnotationRules

`AnnotationRules` checks that annotation types and their properties conform to the
PDF/A specification. Certain annotation types are not permitted in PDF/A, and widget
annotations have additional constraints.

## PdfARule

`PdfARule` is the abstract base class for all validation rule implementations. Concrete
rule classes implement `validate(parser, format, result)` to check their specific
area of PDF/A compliance and append any violations to the `PdfAValidationResult`.

## Workflow

1. Run `ActionRules.validate()` and `AnnotationRules.validate()`
2. Inspect the `PdfAValidationResult` for violations
3. Apply corresponding fix classes from [PDF/A Fixes](../fixes)
4. Re-validate to confirm compliance

## See Also

- [Aspose.PDF for Java — Enterprise Documentation](https://docs.aspose.com/pdf/java/)