CreatePreflightReportExA

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)

PDF/UA reader profile selection

PDF/UA checks select part 2 when XMP identifies pdfuaid:part=2 and otherwise retain the part 1 checks; 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 and unverified scope

Use CheckFilePDFUACompliance or RunPDFUAValidationPipelineTask to force a target part and GetPDFUAReadValidationCoverageJSON to inspect capability limits

Description

The trailing A denotes the ANSI (char) DLL entry point; the ActiveX/COM surface exposes only the Unicode form. Behaviour is identical to CreatePreflightReportEx and string arguments are interpreted using the current SetAnsiMode code page

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 DLCreatePreflightReportExA(InstanceID: Integer; InputFileName: PAnsiChar; Password: PAnsiChar; ComplianceTests: Integer; Options: Integer; ReportFormat: Integer): PAnsiChar;

DLL

const char* DLCreatePreflightReportExA(int InstanceID, const char* InputFileName, const char* Password, int ComplianceTests, int Options, int ReportFormat);

Parameters

InputFileNameFull path of the PDF file to validate. The file is opened read-only and is not modified
PasswordPassword used to open the file. Pass an empty string for unencrypted documents
ComplianceTestsBit mask selecting which checks to include: 1 for PDF/A, 2 for PDF/UA, 3 or 0 for both
OptionsBit flags passed through to each selected compliance check. Pass 1 to stop each check after its first issue
ReportFormatOutput 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 values

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