SavePreflightReportEx

合規性、文件檢查

描述

以 CreatePreflightReportEx 建立預檢報告,並寫入 UTF-8 檔案。輸出需要 JSON、HTML 或 CSV 而不是預設純文字報告時,使用這個 overload。

語法

Delphi

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

參數

InputFileName要驗證的 PDF 檔案完整路徑。
Password開檔用的密碼。未加密文件請傳空字串。
ReportFileName目的地報告路徑。上層目錄會自動建立;傳入空值會傳回 0。
ComplianceTests選擇納入哪些檢查的位元遮罩:1 為 PDF/A,2 為 PDF/UA-1,3 或 0 為兩者。
Options位元旗標,原樣傳給每個所選符合性檢查。傳 1 可讓每項檢查在第一個問題後停止。
ReportFormat輸出格式選擇器:0 為文字,1 為 JSON,2 為 HTML,3 為 CSV。

傳回值

0報告檔名為空。
1報告產生並寫出成功。

備註

報告由 CreatePreflightReportEx 產生,再以 UTF-8 儲存。開檔、驗證、建目錄與寫入錯誤會以例外形式從底層的檔案與符合性檢查路徑浮上來;傳回值只區分空的目的路徑與成功產生的報告。

報告格式合約、命令列示範、批次模式與比較流程,請參閱 Preflight Reports。

範例

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);

另見

Preflight Reports, SavePreflightReport, CreatePreflightReportEx, ComparePreflightReports, CheckFileCompliance