Skip to main content

ComplianceIssue Class

A PDF/A or PDF/UA compliance issue.

Declaration

public class ComplianceIssue extends JavaObject

Remarks

ConversionResult.getIssues() and ValidationResult.getIssues() methods return ComplianceIssue objects.

Refer to the following help topic for additional information: Convert and Validate PDF/A and PDF/UA Documents — PDF Document API for Java.

Example

Validate a PDF Document Against PDF/A-3b

The following code snippet validates a document against PDF/A-3b and prints compliance issues:

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)) {
            ValidationResult result = pdfDocument.validatePdfA(PdfACompatibility.PDF_A3B);
            System.out.println("PDF/A-3b compliant: " + result.getIsValid());

            for (ComplianceIssue issue : result.getIssues()) {
                String location = issue.getPageIndex() >= 0
                        ? "page " + (issue.getPageIndex() + 1)
                        : "document";
                System.out.println(issue.getSeverity() + " (" + location + "), "
                        + issue.getRule() + ": " + issue.getMessage());
            }
        }
    }
}

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
ComplianceIssue

Methods

getMessage() Method

Returns the issue description.

Declaration

public String getMessage()

Returns

Type Description
String

The issue description.

getPageIndex() Method

Returns the index of the page that contains the issue.

Declaration

public int getPageIndex()

Returns

Type Description
int

The zero-based page index, or -1 if the issue is not related to a specific page.

getRule() Method

Returns the compliance rule that the issue concerns.

Declaration

public ComplianceRule getRule()

Returns

Type Description
ComplianceRule

The compliance rule.

getSeverity() Method

Returns the issue severity.

Declaration

public ComplianceIssueSeverity getSeverity()

Returns

Type Description
ComplianceIssueSeverity

The issue severity.

Remarks

The getSeverity() method returns the following values:

Value Description
INFORMATION The issue is an information message (for example, the API embedded a font subset during conversion).
WARNING The issue is a warning (for example, the API removed content during conversion or cannot verify a requirement). Warnings do not make the document invalid.
ERROR The issue is an error. The document does not conform to the standard.