CheckFilePDFUACompliance

Compliance, Document inspection

Requires the Enterprise edition — in Delphi, C++Builder and Lazarus code create the library as TPDFlibEnterprise (unit PDFlibEnterprise); the Enterprise DLL and ActiveX builds provide it unchanged; other editions keep the method, which returns 0, an empty string or False and sets LastErrorCode to 900 (PDFLIB_ERROR_ENTERPRISE_REQUIRED)

Description

Audit a PDF file using an explicit PDF/UA reader profile

Syntax

Delphi

Function TPDFlib.CheckFilePDFUACompliance(Const InputFileName, Password: WideString;
  TargetPart, Options: Integer): Integer; Virtual;

DLL

int DLCheckFilePDFUACompliance(int InstanceID, const wchar_t* InputFileName, const wchar_t* Password, int TargetPart, int Options);
int DLCheckFilePDFUAComplianceA(int InstanceID, const char* InputFileName, const char* Password, int TargetPart, int Options);

ActiveX

Function PDFlib::CheckFilePDFUACompliance(InputFileName As String, Password As String, TargetPart As Long, Options As Long) As Long

Parameters

InputFileNamePDF file to audit; the file is read without being modified
PasswordOpen password, or an empty string for an unencrypted file
TargetPart0 auto-detects the part from XMP and selects PDF/UA-2 only when pdfuaid:part=2 is present, 1 forces PDF/UA-1, 2 forces PDF/UA-2; values outside 0..2 are rejected
Options1 stops the audit at the first critical violation; any other value continues and collects every detected issue

Return values

HandleA nonzero issue-list handle holding NNNNN description lines; read items with 1-based GetStringListItem indexes and release the handle with ReleaseStringList
0The implemented checks reported no issue, or the audit could not start; a file, password or target failure also leaves a nonzero LastErrorCode, so inspect it before treating zero as a pass

Remarks

TargetPart=0 selects part 2 only when XMP identifies pdfuaid:part=2; otherwise it selects part 1, 1 forces PDF/UA-1 and 2 forces PDF/UA-2

PDF/UA-2 checks cover identification part, revision and prefix, effective PDF 2.0 version, metadata title, marked status, display title, namespace references, role resolution, Document roots, parent links, and bounded tree traversal

A pass means no problems were found by the implemented checks; checked structural, content, font, annotation, language and form evidence remains bounded, and semantic reading order, alternative-description quality and complete human accessibility review remain unverified

Both parts report an Artifact sequence opened inside marked content that carries an MCID (10084) and such tagged content opened inside an Artifact (10085), including Form XObjects painted in either context; when the table, embedded-file, outline and heading checks cannot run to the end on a malformed structure tree, 10086 reports that they are incomplete instead of letting the file pass; whether a piece of content truly is real content or an artifact, and whether the reading order is logical, remain human accessibility review

Returns an issue-list handle or zero when implemented checks pass; file, password or invalid-target failures return zero with a nonzero LastErrorCode, so inspect that error before treating zero as success

Read issue items using 1-based GetStringListItem indexes and release every nonzero handle with ReleaseStringList; Options=1 stops at the first issue and other values collect all detected issues

Shared form evidence in PDF/UA

PDF/UA-1 and PDF/UA-2 reader checks reuse the bounded ISO 32000 field-schema evidence for required and inherited entries, flags, choice membership and index precedence, supported button states and qualified logical appearance text; automatic part selection and shared validation pipelines use the same checks

Finding 00139 remains a proven base-format violation and 00140 remains warning/incomplete; an unrelated accessibility or archival error does not erase incomplete evidence, and an incomplete finding does not downgrade a separately proven error

These shared checks do not import PDF/A-only restrictions on actions or NeedAppearances into PDF/UA; approved PDF 2.0 pushbutton value behavior applies to PDF/UA-2, while PDF/UA-1 retains its base-edition rules

Direct catalog AcroForm dictionaries remain resolvable after reader-side promotion into the document object table; the audit does not invent an unresolved-reference failure or lose the applicable field checks

The coverage JSON exposes checkedFormEvidence, incompleteOn and formLimits for explicit and automatic targets; these are capability declarations rather than per-document results, and fullCertification remains false because logical reading order, actual content/artifact classification, semantic labels and interactive assistive-technology behavior require separate review

See also

RunPDFUAValidationPipelineTask, GetPDFUAReadValidationCoverageJSON