SaveValidationReport

合規性

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

描述

把檔案的結構化驗證報告以 UTF-8 寫到磁碟

語法

Delphi

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

ActiveX

Function PDFlib::SaveValidationReport(InputFileName As String, Password As String, ReportFileName As String, ComplianceTests As Long, Options As Long, ReportFormat As Long) As Long

DLL

int DLSaveValidationReport(int InstanceID, const wchar_t* InputFileName, const wchar_t* Password, const wchar_t* ReportFileName, int ComplianceTests, int Options, int ReportFormat);
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 表示每項檢查在第一個發現就停止
ReportFormat0 = 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