function BuildPdfPreflightReport(Pdf: TPdf): TPdfPreflightReport; overload;
function BuildPdfPreflightReport(Pdf: TPdf; Standards: TPdfPreflightStandards): TPdfPreflightReport; overload;
function PdfPreflightStandardName(Standard: TPdfPreflightStandard): string;
function PdfPreflightStatusName(Status: TPdfPreflightStatus): string;
| Type | Description |
|---|---|
TPdfPreflightStandard | Standard selector with ppsPdfA, ppsPdfUa, ppsPdfE, ppsPdfX, ppsPdfR, and ppsPdfVT. |
TPdfPreflightStandards | Set type used by BuildPdfPreflightReport; AllPdfPreflightStandards selects every supported standard. |
TPdfPreflightStatus | Per-standard status: pfsPass, pfsActionRequired, or pfsReview. |
TPdfPreflightIssue | Issue row with standard, issue code, category, description, and recommendation. |
TPdfPreflightIssueCategoryCount | Aggregated issue-category row returned by IssueCategoryCounts. |
TPdfPreflightStandardResult | One standard result with conformance name, compliance flag, status text, priority, next action, and issue rows. |
TPdfPreflightReport | Complete report with source file, generation timestamp, scope note, standard results, summary counters, and export helpers. |
BuildPdfPreflightReport calls ValidatePdfA, ValidatePdfUa, ValidatePdfE, ValidatePdfX, ValidatePdfR, and ValidatePdfVT for an active TPdf document and returns a TPdfPreflightReport.
The report contains one row per selected standard, the detected conformance name, TPdfPreflightStatus, status text, priority, next-action guidance, issue codes, issue categories, issue-category counts from TPdfPreflightReport.IssueCategoryCounts, and a recommended action for each issue. StandardCount, CompliantStandardCount, TotalIssueCount, and IssueCategoryCounts expose the same summary data programmatically.
TPdfPreflightReport.ToText, ToHtml, ToMarkdown, ToJson, and ToCsv return report content, while SaveTextToFile, SaveHtmlToFile, SaveMarkdownToFile, SaveJsonToFile, and SaveCsvToFile write it to disk.
| Format | Shape |
|---|---|
| Text | Plain-text source, generated time, scope note, summary, standard rows, action plan, issue categories, and issue details. |
| HTML | Standalone HTML report with status styling, an issue-category table, standard table, and issue table. |
| Markdown | Markdown headings and tables for standards, issue categories, action plan, and issue details. |
| JSON | Structured object with format, sourceKind, summary, issueCategoryCounts, and per-standard issue arrays. |
| CSV | Spreadsheet-friendly rows identified by RowType: Summary, Standard, Category, and Issue. |
ValidatePdf* methods.Demo\Delphi\PreflightReport, Demo\Lazarus\PreflightReport, and Demo\CBuilder\PreflightReport demonstrate standard selection, status / priority summary rows, issue-category counts in generated reports, text / Markdown / JSON / CSV preview switching, and TXT / HTML / Markdown / JSON / CSV export.Demo\Delphi\PreflightReportCli demonstrates the same report path in a scriptable console workflow. Single-file mode accepts input, output, optional password, report format, standards=, attach=, and failon=. With no arguments, it creates a sample PDF beside the executable and writes a text report.batch=, skips blank lines and # comments, and resolves missing relative paths from the list file's folder. Directory mode scans batchdir= for *.pdf files, optionally recurses, and sorts discovered paths before processing.outdir= routes batch reports into a shared folder. If multiple inputs resolve to the same report path, later files receive -2, -3, and later suffixes instead of overwriting earlier reports.summary=batch.txt, summary=batch.json, and summary=batch.html include run settings, aggregate file totals, standard status totals, and one row per input. summary=batch.csv is a row-oriented manifest that repeats run settings on each input row and includes per-file status counts.attach=output.pdf is single-file only. It embeds the generated report as a document-level attachment in a different PDF path and never writes back to the input file.failon=issues matches any reported issue, failon=action matches any Action required row, and failon=review matches Action required or Review rows. The CLI exits 0 on success, 1 on runtime errors, or 2 when a selected failon= rule matches after reports are written.
uses FPdfPreflightReport;
var
Report: TPdfPreflightReport;
begin
Pdf1.FileName := 'C:\Incoming\job.pdf';
Pdf1.Active := True;
Report := BuildPdfPreflightReport(Pdf1, [ppsPdfA, ppsPdfX]);
Memo1.Lines.Text := Report.ToText;
Report.SaveHtmlToFile('C:\Incoming\job.preflight.html');
Report.SaveMarkdownToFile('C:\Incoming\job.preflight.md');
Report.SaveJsonToFile('C:\Incoming\job.preflight.json');
Report.SaveCsvToFile('C:\Incoming\job.preflight.csv');
end;