SavePreflightReportExA

合規性、文件檢查

需要 Enterprise 版本。在 Delphi、C++Builder 與 Lazarus 程式碼中,請以 TPDFlibEnterprise(PDFlibEnterprise 單元)建立程式庫;Enterprise DLL 與 ActiveX 組建原樣提供。其他版本保留此方法,方法會傳回 0、空字串或 False,並將 LastErrorCode 設為 900(PDFLIB_ERROR_ENTERPRISE_REQUIRED)

描述

結尾的 A 表示 ANSI(char)DLL 進入點;ActiveX/COM 介面只提供 Unicode 形式。行為與 SavePreflightReportEx 完全相同,字串參數依目前 SetAnsiMode 的字碼頁解讀

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

語法

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

參數

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