dealfonso / sapp

Simple and Agnostic PDF Document Parser in PHP - sign PDF docs using PHP
GNU Lesser General Public License v3.0
121 stars 32 forks source link

Add certificate options when placing digital signatures (#64) #68

Closed aphoe closed 7 months ago

aphoe commented 7 months ago

To add certificate options (reason, location, etc), you can now call set_metadata_props() before you call to_pdf_file_s()

Example:

   $cert = [
        'cert' => $certificate,
        'pkey' => $pkey,
    ];

    $obj = PDFDoc::from_string($pdf);

    $obj->set_signature_certificate($cert);
    $obj->set_metadata_props($name, $reason, $location, $contactInfo);

    $signed = $obj->to_pdf_file_s();
aphoe commented 6 months ago

Hi @dealfonso, can you create a v1.4.3 tag so we can pull it directly from Packagist with a composer update?

Thank you.

dealfonso commented 6 months ago

done

aphoe commented 6 months ago

Thank you very much