property SignatureCount: Integer; // read only
SignatureCount returns the number of signature dictionaries currently present in
the document. PDFium enumerates AcroForm signature fields (PDF 1.7 spec section 12.8)
— each entry corresponds to a /Sig field whose /V value
is a signature dictionary (/Type /Sig) carrying the
/Contents hex string and /ByteRange coverage.
The value is 0 when Active is False, when the
PDF carries only empty signature placeholders that have not been filled yet, or when
the file simply was not signed. Note that this is a document-level count: signature
fields can be visually placed on any page but the count itself is global.
Use Signature[Index] to retrieve a single TPdfSignature
record containing the raw PKCS#7 Content bytes, the
Encoding string (adbe.pkcs7.detached,
ETSI.CAdES.detached, etc.), the signer-supplied Reason /
Time strings and the Permission level. PDFiumVCL exposes
only inspection data; verifying the signature requires a third-party cryptography
library to validate the PKCS#7 blob against the document byte range.
n validates the state at signing time, not
necessarily the current state.SaveToFile as long as no new
field is added; signing externally and saving via FPDF_SaveAsCopy
preserves existing signatures byte-for-byte.FormFieldCount to see whether the document has
additional non-signature interactive fields.
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;