Validates PDF documents against archival (PDF/A) and accessibility (PDF/UA) conformance standards.
The validator only accepts documents whose underlying type is PDF; other formats are rejected and are never converted implicitly. By default the document is validated against the conformance level it claims in its metadata. Set the Conformance property to force validation against a specific conformance level instead.
using Nutrient;The SDK creates this class through factory methods or other SDK objects.
Properties
Conformance
public PdfValidationConformance Conformance { get; set; }The conformance level the document is validated against.
Type: PdfValidationConformance
Methods
Set
public static PdfValidator Set(Document document)Creates a PdfValidator instance for the specified document.
Parameters
| Name | Type | Description |
|---|---|---|
document | Document | The PDF document to validate. |
Returns: PdfValidator - A PdfValidator instance ready to validate the document.
Validate
public PdfValidationResult Validate()Validates the document against the conformance level specified by the Conformance property.
Returns: PdfValidationResult - A PdfValidationResult describing the outcome: whether the document conforms, the conformance level it was validated against, and a detailed report. When the property is set to Auto and the document claims no conformance in its metadata, no validation is performed and the result reports the document as not valid.
Resource management
public void Dispose()PdfValidator implements IDisposable and owns native resources. Always call Dispose() or use a C# using declaration: it is not released automatically.