CreatePreflightReport
Compliance, Document inspection
Description
Creates a plain-text preflight report for an external PDF file by running the existing PDF/A and PDF/UA-1 file-compliance checks and formatting their results into one reusable report body. This is the convenience API to use when an application wants a human-readable report instead of manually calling CheckFileCompliance, GetStringListCount, GetStringListItem, and ReleaseStringList.
Syntax
Delphi
function TPDFlib.CreatePreflightReport(const InputFileName, Password: WideString; ComplianceTests, Options: Integer): WideString;Parameters
| InputFileName | Full path of the PDF file to validate. The file is opened read-only and is not modified. |
|---|---|
| Password | Password used to open the file. Pass an empty string for unencrypted documents. |
| ComplianceTests | Bit mask selecting which checks to include. 1 — PDF/A. 2 — PDF/UA-1. 3 — both PDF/A and PDF/UA-1. Passing 0 also runs both checks. |
| Options | Bit flags passed through to each underlying compliance check. 0 — Report every issue found in each selected check. 1 — Stop each selected check after the first issue. |
Return value
Returns a UTF-16 text report containing the report header, one section per selected compliance check, and a final summary with Total issues and Result lines.
Remarks
The report API does not replace a dedicated external PDF/A validator. It packages the library's built-in first-line PDF/A and PDF/UA-1 diagnostics into a stable application-facing report. Use CreatePreflightReportEx when the application needs text, JSON, HTML, or CSV output, and use CheckFileCompliance directly when it needs individual issue-list handles instead of formatted text.
The plain-text report is the canonical source for every formatted report. It contains volatile Generated: metadata, an Input: path, the selected checks, the issue collection mode, one section for each selected compliance test, and a final summary with Total issues and Result.
For command-line and batch-report workflows, see Preflight Reports.
Example
var
Report: WideString;
begin
Report := PDF.CreatePreflightReport('output.pdf', '', 1 or 2, 0);
WriteLn(Report);
end;See also
Preflight Reports, CreatePreflightReportEx, SavePreflightReport, ComparePreflightReports, CheckFileCompliance, GetPDFUADiagnostics, SetPDFAMode, SetPDFUAMode