SavePreflightReportEx

Compliance, Document inspection

Description

Creates a preflight report with CreatePreflightReportEx and writes it to a UTF-8 file. Use this overload when the output should be JSON, HTML, or CSV instead of the default plain-text report.

Syntax

Delphi

function TPDFlib.SavePreflightReportEx(const InputFileName, Password, ReportFileName: WideString; ComplianceTests, Options, ReportFormat: Integer): Integer;

Parameters

InputFileNameFull path of the PDF file to validate.
PasswordPassword used to open the file. Pass an empty string for unencrypted documents.
ReportFileNameDestination report path. Parent directories are created automatically. Passing an empty value returns 0.
ComplianceTestsBit mask selecting which checks to include: 1 for PDF/A, 2 for PDF/UA-1, 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 for text, 1 for JSON, 2 for HTML, or 3 for CSV.

Return values

0The report file name was empty.
1The report was generated and written successfully.

Remarks

The report is generated by CreatePreflightReportEx and then saved as UTF-8. File-open, validation, directory-creation, and write errors are surfaced as exceptions from the underlying file and compliance-check paths; the return value only distinguishes an empty destination path from a generated report.

For the report-format contract, command-line demo, batch mode, and comparison workflow, see Preflight Reports.

Example

PDF.SavePreflightReportEx('output.pdf', '', 'output-preflight.json', 1 or 2, 0, 1);
PDF.SavePreflightReportEx('output.pdf', '', 'output-preflight.html', 1 or 2, 0, 2);
PDF.SavePreflightReportEx('output.pdf', '', 'output-preflight.csv', 1 or 2, 0, 3);

See also

Preflight Reports, SavePreflightReport, CreatePreflightReportEx, ComparePreflightReports, CheckFileCompliance