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.
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.

Return values

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

Remarks

Använd SavePreflightReportEx när utdata ska vara JSON, HTML eller CSV; Filöppnings-, validerings- eller skrivfel visas som undantag från de underliggande fil- och efterlevnadskontrollsbanorna; Bädda in anropet när det används i kommandoradsverktyg eller tjänster som behöver slutkoder på processnivå

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