Sample code for 30+ languages & platforms
AutoIt

PDF List Unsigned Signature Fields

See more PDF Signatures Examples

Demonstrates how to list the unsigned signature fields in a PDF.

Note: This example requires Chilkat v9.5.0.90 or greater.

Chilkat AutoIt Downloads

AutoIt
Local $bSuccess = False

; This example requires the Chilkat API to have been previously unlocked.
; See Global Unlock Sample for sample code.

$oPdf = ObjCreate("Chilkat.Pdf")

; Load a PDF containing 2 remaining unsigned signature fields:
$bSuccess = $oPdf.LoadFile("qa_data/pdf/doctor_patient_parent.pdf")
If ($bSuccess = False) Then
    ConsoleWrite($oPdf.LastErrorText & @CRLF)
    Exit
EndIf

; Note: This example requires Chilkat v9.5.0.90 or greater.
$oJson = ObjCreate("Chilkat.JsonObject")
$oPdf.GetUnsignedSigFields($oJson)

$oJson.EmitCompact = False
ConsoleWrite($oJson.Emit() & @CRLF)

; Result:
; {
;   "unsignedSigField": [
;     "doctor_signature",
;     "parent_signature"
;   ]
; }

; To iterate over the field names:
Local $strVal

Local $i = 0
Local $iCount_i = $oJson.SizeOfArray("unsignedSigField")
While $i < $iCount_i
    $oJson.I = $i
    $strVal = $oJson.StringOf("unsignedSigField[i]")
    ConsoleWrite($strVal & @CRLF)
    $i = $i + 1
Wend