CreatePreflightReport
Compliance, Document inspection
Description
透過執行現有的 PDF/A 和 PDF/UA-1 檔案合規性檢查,並將其結果格式化為一個可重複使用的報告主體,從而為外部 PDF 檔案建立純文字預檢報告;當應用程式需要人類可讀的報告,而不是手動呼叫 CheckFileCompliance、GetStringListCount、GetStringListItem 和 ReleaseStringList 時,這是最方便使用的 API
Syntax
Delphi
Function TPDFlib.CreatePreflightReport(Const InputFileName, Password: WideString; ComplianceTests, Options: Integer): WideString;
Parameters
| InputFileName | 要驗證的 PDF 檔案完整路徑 The file is opened read-only and is not modified. |
|---|---|
| Password | 用於開啟檔案的密碼;對於未加密的文件請傳遞空字串 |
| ComplianceTests | 選擇要包含之檢查的位元遮罩; 1 — PDF/A; 2 — PDF/UA-1; 3 — 同時包含 PDF/A 和 PDF/UA-1;傳入 0 也會執行這兩項檢查 |
| Options | 傳遞給每個底層合規性檢查的位元旗標; 0 — 報告在每個選定檢查中發現的所有問題; 1 — 在發現第一個問題後停止每個選定檢查 |
Return value
傳回一個 UTF-16 文字報告,其中包含報告標頭、每個選定合規性檢查的一個區段,以及包含 Total issues 和 Result 行的最終摘要
Remarks
此報告 API 並未取代專用的外部 PDF/A 驗證器;它將程式庫內建的第一線 PDF/A 和 PDF/UA-1 診斷打包成一個穩定的、面向應用程式的報告;當應用程式需要文字、JSON、HTML 或 CSV 輸出時,請使用 CreatePreflightReportEx,而當需要個別問題清單控制代碼而非格式化文字時,請直接使用 CheckFileCompliance
純文字報告是所有格式化報告的規範來源;其包含易失的 Generated: 中繼資料、一個 Input: 路徑、選定的檢查、問題收集模式、每個選定合規性測試的區段,以及包含 Total issues 和 Result 的最終摘要
關於命令列與批次報告工作流程,請參閱 預檢報告
Example
var
Report: WideString;
begin
Report := PDF.CreatePreflightReport('output.pdf', '', 1 or 2, 0);
WriteLn(Report);
end;See also
預檢報告, CreatePreflightReportEx, SavePreflightReport, ComparePreflightReports, CheckFileCompliance, GetPDFUADiagnostics, SetPDFAMode, SetPDFUAMode