SavePreflightReport

Compliance, Document inspection

Description

Creates a plain-text preflight report with CreatePreflightReport and writes it to a UTF-8 text file. The output directory is created automatically when it does not already exist.

Syntax

Delphi

Function TPDFlib.SavePreflightReport(Const InputFileName, Password, ReportFileName: WideString; ComplianceTests, Options: 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 text-report path. Parent directories are created automatically. Passing an empty value returns 0.
ComplianceTestsMasque de bits sélectionnant les contrôles à inclure : 1 pour PDF/A, 2 pour PDF/UA-1, 3 ou 0 pour les deux
OptionsDrapeaux de bits transmis à chaque contrôle de conformité sélectionné ; passez 1 pour arrêter chaque contrôle après son premier problème

Return values

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

Remarks

Use SavePreflightReportEx when the output should be JSON, HTML, or CSV. File-open, validation, or write errors are surfaced as exceptions from the underlying file and compliance-check paths. Wrap the call when using it in command-line tools or services that need process-level exit codes.

Example

if PDF.SavePreflightReport('output.pdf', '', 'output-preflight.txt', 1 or 2, 0) = 1 then
  WriteLn('Preflight report saved.');

See also

Preflight Reports, SavePreflightReportEx, CreatePreflightReport, ComparePreflightReports, CheckFileCompliance, ReleaseStringList