Skip to main content

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

com.devexpress.system.JavaObject.clone()
com.devexpress.system.JavaObject.equals(java.lang.Object)
com.devexpress.system.JavaObject.hashCode()
com.devexpress.system.JavaObject.initFields()
com.devexpress.system.JavaObject.memberwiseClone()
com.devexpress.system.JavaObject.toString()
java.lang.Object.finalize()
java.lang.Object.getClass()
java.lang.Object.notify()
java.lang.Object.notifyAll()
java.lang.Object.wait()
java.lang.Object.wait(long)
java.lang.Object.wait(long,int)

Inheritance

Object
com.devexpress.system.JavaObject
ValidationOptions

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

true if the API processes the entire document before validation; otherwise, false.

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

true to process the entire document before validation; otherwise, false.

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.