CreatePreflightReportEx
Compliance, Document inspection
PDF/UA reader profile selection
PDF/UA checks select part 2 when XMP identifies pdfuaid:part=2 and otherwise keep the part 1 checks; the legacy PDF/UA-1 checks described here are not implied to apply to part 2
The PDF/UA-2 profile implements core identification, namespace, role and structure checks; structured reports use PDF/UA-2 and ISO 14289-2 and disclose fullCertification=false together with the unverified scope
Use CheckFilePDFUACompliance or RunPDFUAValidationPipelineTask to force a target part and GetPDFUAReadValidationCoverageJSON to inspect capability limits
Description
Creates a preflight report for an external PDF file and converts the report to the requested output format. This is the format-aware companion to CreatePreflightReport, which always returns the plain-text report.
Syntax
Delphi
Function TPDFlib.CreatePreflightReportEx(Const InputFileName, Password: WideString; ComplianceTests, Options, ReportFormat: 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 for PDF/A, 2 for PDF/UA, 3 or 0 for both. |
| Options | Bit flags passed through to each selected compliance check. Pass 1 to stop each check after its first issue. |
| ReportFormat | Output format selector. 0 — plain text. 1 — JSON object with header fields, per-check sections, issue arrays, and summary fields. 2 — standalone HTML document containing the escaped text report. 3 — CSV rows with metadata, selected checks, issue codes and messages, and final summary rows. |
Return value
Returns the generated report in the selected format. Unknown ReportFormat values fall back to the plain-text format.
Remarks
The JSON, HTML, and CSV formats are generated from the same text report used by CreatePreflightReport, so pass/fail status and issue counts stay consistent across all report formats.
The JSON object exposes header fields, a sections array, issue-string arrays, and a summary object. The HTML form is a standalone document that escapes the text report inside a preformatted block. The CSV form uses fixed kind,section,status,code,message columns and separates metadata, check status, issue rows, and summary rows for spreadsheet or CI parsing.
For the full report-format contract and demo command-line examples, see Preflight Reports.
Example
JsonReport := PDF.CreatePreflightReportEx('output.pdf', '', 1 or 2, 0, 1);
HtmlReport := PDF.CreatePreflightReportEx('output.pdf', '', 1 or 2, 0, 2);
CsvReport := PDF.CreatePreflightReportEx('output.pdf', '', 1 or 2, 0, 3);See also
Preflight Reports, CreatePreflightReport, SavePreflightReportEx, ComparePreflightReports, CheckFileCompliance