ValidationOptions Class
Contains options for PDF/A and PDF/UA validation.
Declaration
public class ValidationOptions extends JavaObject
Remarks
Pass a ValidationOptions object to the PdfDocument.validatePdfA(compatibility, options) or PdfDocument.validatePdfUA(compatibility, options) method.
Refer to the following help topic for additional information: Convert and Validate PDF/A and PDF/UA Documents — PDF Document API for Java.
Example: Process the Entire Document Before PDF/A Validation
The following code snippet processes the entire document before PDF/A-2b validation:
import java.io.*;
import java.nio.file.*;
import com.devexpress.docs.pdf.*;
public class Main {
public static void main(String[] args) throws Exception {
try (InputStream inputStream = Files.newInputStream(Path.of("Document.pdf"));
PdfDocument pdfDocument = new PdfDocument(inputStream)) {
ValidationOptions options = new ValidationOptions();
options.setForcePreProcessing(true);
ValidationResult result = pdfDocument.validatePdfA(PdfACompatibility.PDF_A2B, options);
System.out.println("PDF/A-2b compliant: " + result.getIsValid());
}
}
}
Inherited Members
Inheritance
ValidationOptions()
Initializes a new instance of the ValidationOptions class.
Declaration
public ValidationOptions()
Methods
getForcePreProcessing() Method
Returns whether the API processes the entire document before validation.
Declaration
public boolean getForcePreProcessing()
Returns
| Type | Description |
|---|---|
| boolean |
|
setForcePreProcessing(boolean value) Method
Sets whether the API processes the entire document before validation.
Declaration
public void setForcePreProcessing(boolean value)
Parameters
| Name | Type | Description |
|---|---|---|
| value | boolean |
|
Remarks
If you do not call the setForcePreProcessing(true) method and the API saves the document as an incremental update (for example, a loaded document that contains signatures), the validation checks the resulting document.
If you call the setForcePreProcessing(true) method, the API processes the entire document before validation. Later calls to the PdfDocument.save method rewrite the entire document instead of saving an incremental update. A full rewrite invalidates existing signatures.