dealfonso / sapp

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

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

Closed aphoe closed 5 months ago

aphoe commented 5 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 5 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 5 months ago

done

aphoe commented 5 months ago

Thank you very much