Developers can now add signature options (e.g., Name, Reason, Location, and ContactInfo) to a document's digital signature.
How it works
// Create an array with the fields
$options = [
'Name' => '*** Name of signer***',
'Reason' => '*** Reason for signing ***',
'Location' => '*** Geographical location where it was signed ***',
'ContactInfo' => '*** contact information associated with the signer ***',
];
$certificate = [
'cert' => $certificate,
'pkey' => $private_key,
];
$content = file_get_contents('path/to/file.pdf');
$obj = PDFDoc::from_string($content);
$obj->set_signature_certificate($certificate);
$obj->set_signature_options($options); // Use this method to set the options
$signed = $obj->to_pdf_file_s();
file_put_contents('path/to/save/signed/file.pdf', $signed);
Developers can now add signature options (e.g., Name, Reason, Location, and ContactInfo) to a document's digital signature.
How it works