
Question:
I'm trying to digitaly sign PDF document with PHP. I have bought certificate (not using self-signed). What I've got is CER and PEM file. I've tried to generate signed PDF using TCPDF library but with no success. The perfect solution would be to just add signature to existing document (pdf). Any advice?
Answer1:You may want to check out this thread <a href="https://stackoverflow.com/questions/10903682/digitally-signing-a-pdf-using-php-zend-and-openssl" rel="nofollow">Digitally signing a PDF, using PHP, Zend, and openssl</a>
The author posted his solution under the first answer to the question.
Alternatively there is this <a href="http://www.kryptokoder.com/signwithext.html" rel="nofollow">http://www.kryptokoder.com/signwithext.html</a>
Answer2:<a href="https://stackoverflow.com/questions/51209229/is-this-pdf-digital-signed-correctly-php-tcpdf" rel="nofollow">Is this pdf digital signed correctly? PHP/TCPDF</a>
This question will fix your problem if you want to create a pdf and just sign it. My problem also comes when I try to sign an existing pdf. I don't know how to use/import an existing pdf with the TCPDF library.