I'm using mPDF to create a PDF. I want to digitally add a signature to the PDF document.
I can only find online examples for adding a digital signature to a tcPDF object, not an mPDF.
Does anyone have any information on the subject that can help me?
This is my PHP code:
$pdf=new mPDF('en','A4','','DejaVuSansCondensed',$template->margin_left,$template->margin_right,$template->margin_top,$template->margin_bottom,$template->margin_header,$template->margin_footer);
$pdf->setAutoFont();
$pdf->SetHTMLHeader($header);
$pdf->SetHTMLFooter($footer);
$pdf->writeHTML($printable);
$pdf->Output($file_name, "D");
Thank you so much!
Edit (17.05.14):
I had found the next library - here (scroll down) and made some use of it by packing it with the right Zend libraries to make it work out of the box. So if you want to digitally sign a PDF using PHP you can use the next lib. http://www.mediafire.com/download/181rgs86nvr4nd5/signPdf.zip
After several weeks of looking for a PHP solution for signing already generated PHP file this is the only working with good performance solution that I had found, it can be used with any PDF library.
Thanks for Damir for developing this lib.
Old obsolete answer
I am struggling with the same problem as well. The only solution I had found for now is to create the PDF then use https://www.setasign.com/products/fpdi/about/#p-510 to import the PDF into TCPDF.
and then sign it with TCPDF.
first create a class then inherit from fpdi and TCPDF
then do the actual signing
I had tried to use TCPDF signing algorithm and use it in mPdf but failed to do it, so if someone succeed some how I'll be happy to know!