CheckDocumentStructure
文件屬性與遵循性
描述
對所選文件執行結構健檢:每個物件與串流都被強制跑過各自的解碼器,發現的問題以報告傳回
語法
Delphi
Function TPDFlib.CheckDocumentStructure: Integer;傳回值
| 0 | No document is selected. |
|---|---|
| ID | 字串清單控制代碼,供 GetStringListCount 與 GetStringListItem 使用;用 ReleaseStringList 釋放。 |
備註
每個發現是一行 Level,Code,Object,Message,層級為 error、warning 或 info;最後一行是 summary,...,帶錯誤與警告數、檢查過的物件與串流數,以及頁面解析度比例。回報的狀況包括解析失敗的物件(object-decode)、截斷或損毀的單純 Flate 串流(stream-decode,嚴格對照 zlib 結尾標記驗證)、遺失的 trailer 或無法解析的文件目錄、不支援的加密處理器、無法解析的頁面,以及交叉參照資料由位元組掃描重建的文件(repaired)。
把它當成封存或批次處理之前廉價的預檢關卡;標準符合性的深入檢查交給 CheckFileCompliance。
範例
ListID:= PDF.CheckDocumentStructure;
Last:= PDF.GetStringListItem(ListID, PDF.GetStringListCount(ListID));
if Pos('summary,0 errors', Last)<> 1 then
ShowMessage('structural problems found');
PDF.ReleaseStringList(ListID);另見
CheckFileCompliance, CheckObjects, AuditDocumentSpace, GetDocumentRepaired