PDFium Delphi Component 文件

SignatureCount 屬性

元件: TPdf  ·  單元: PDFium
文件中內嵌的數位簽章欄位數量

Syntax

property SignatureCount: Integer; // read only

Description

SignatureCount 傳回文件中目前存在的簽章字典數量。PDFium 會列舉 AcroForm 簽章欄位(PDF 1.7 規範第 12.8 節)— 每個項目對應一個 /Sig 欄位,其 /V 值為簽章字典(/Type /Sig),帶有 /Contents 十六進位字串與 /ByteRange 涵蓋範圍

當 Active 為 False、PDF 只包含尚未填署的空白簽章佔位欄位,或檔案根本未簽署時,值為 0。請注意這是文件層級的計數:簽章欄位可在視覺上放置於任何頁面,但計數本身是全域的

使用 Signature[Index] 可取得單一 TPdfSignature 記錄,其中包含原始 PKCS#7 Content 位元組、Encoding 字串(adbe.pkcs7.detached、ETSI.CAdES.detached 等)、簽署者提供的 Reason / Time 字串以及 Permission 等級。PDFium Delphi Component 僅提供檢視資料;驗證簽章需要第三方密碼學程式庫,針對文件位元組範圍驗證 PKCS#7 資料

Remarks

Example

var I: Integer;
var Sig: TPdfSignature;
for I := 0 to Pdf1.SignatureCount - 1 do
begin
  Sig := Pdf1.Signature[I];
  Memo1.Lines.Add(Format('Signer reason: %s, time: %s',
    [Sig.Reason, Sig.Time]));
end;

See Also

Signature, FormFieldCount, FormType