GetSignatureFieldInfo
Security and signatures, form fields
Description
Fills Info with the form-field index, title and signed state of the Index-th signature field, numbering signature fields densely from 1 so that callers can iterate a complete range, and returns that field's 1-based form-field index. Returns 0 with Info left zeroed when Index is out of range.
Syntax
Delphi
Function TPDFlib.GetSignatureFieldInfo(Index: Integer; Out Info: TPDFlibSignatureFieldInfo): Integer;
Parameters
Index is a 1-based position among signature fields only, so it must lie in 1..GetSignatureFieldCount and is not an index into the form-field list. Info receives the matching field: FieldIndex is the field's 1-based form-field index for use with the GetFormField* accessors, FieldName is the fully qualified field title, and Signed tells whether the field already carries a signature dictionary. Info is set to FieldIndex = 0, an empty name and Signed = false on entry, so a failed call leaves it cleared rather than stale.
Return values
The matched field's 1-based index in the document's form-field list, which is the same value written to Info.FieldIndex and the index accepted by GetFormFieldTitle, GetFormFieldValue and the other form-field accessors. The result is 0 when Index is below 1 or past the last signature field, including when the document has no form at all.
Remarks
Signature fields are numbered densely by walking every form field in document order and counting only the ones typed ftSignature, which keeps the range contiguous even though signature fields are usually a small minority of a form. The signed test looks for a non-null /V on the field dictionary, so a field signed by any means reports true regardless of whether the signature is a certification or an approval signature, and regardless of whether the signer's certificate could be verified - verification is the caller's job, since this field reports the presence of a signature and nothing about its validity. Note that the return value is a form-field index rather than a raw PDF object number: the object number of the field dictionary itself is not exposed here.