SavePreflightReportExA

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)

Description

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

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

DLL

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

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