SaveValidationReportA
合規性
需要 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 形式。行為與 SaveValidationReport 完全相同,字串參數依目前 SetAnsiMode 的字碼頁解讀
把檔案的結構化驗證報告以 UTF-8 寫到磁碟
語法
Delphi
Function DLSaveValidationReportA(InstanceID: Integer; InputFileName: PAnsiChar; Password: PAnsiChar; ReportFileName: PAnsiChar; ComplianceTests: Integer; Options: Integer; ReportFormat: Integer): Integer;
DLL
int DLSaveValidationReportA(int InstanceID, const char* InputFileName, const char* Password, const char* ReportFileName, int ComplianceTests, int Options, int ReportFormat);
參數
| InputFileName | 要驗證的 PDF 檔案 |
|---|---|
| Password | 開檔所需的密碼;空字串表示無 |
| ReportFileName | 要寫出的報告檔案;缺少的目錄會自動建立 |
| ComplianceTests | 選擇檢查項目的位元遮罩:1 = PDF/A,2 = PDF/UA-1,0 = 兩者 |
| Options | 原樣傳給各項檢查;1 表示每項檢查在第一個發現就停止 |
| ReportFormat | 0 = XML,1 = JSON |
傳回值
| 1 | 報告已寫出 |
|---|---|
| 0 | 未提供報告檔名,或輸入檔案不存在 |
備註
報告內容與 CreateValidationReport 相同,只差交付方式。把報告寫在它所描述產出物的旁邊,建置日誌保持可稽核,又不必把文件留在記憶體裡
範例
if PDF.SaveValidationReport('invoice.pdf', '', 'reports\invoice.xml', 0, 0, 0)= 0 then
ShowMessage('the report could not be written');另請參閱
CreateValidationReport, SavePreflightReport, SavePreflightReportEx