Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
639 views
in Technique[技术] by (71.8m points)

php - PDF Multiple Digital sign

I visit into a similar issue in another post. Using FPDI and TCPDF I can sign a PDF document with a signature without problems, but when it comes to multiple signatures the previous signature remains unformatted and only the last signed is valid. Solution can you recommend me?, Thanks.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

UPDATE

I was checking the latest version of the TCPDF code and see that setSignature() has a paramater called $approval. If it sets to 'A' , the code does different processing for the digital signature and the parameter descriptions suggests it is for incremental update (i.e. @param $approval (string) Enable approval signature eg. for PDF incremental update). I haven't seen that value being mentioned in the documentation. Try using that for additional signatures after the first one.

setSignature() method

putSignature() method

Or use a paid solution like PDFTron, which supports PDF

https://www.pdftron.com/documentation/samples/php/DigitalSignaturesTest

ORIGINAL VERSION

This can only be done through incremental update, which allows appending new section without modifying the original document that's been signed previously. See section 7.5.6 in PDF format spec:

https://www.adobe.com/content/dam/acom/en/devnet/acrobat/pdfs/PDF32000_2008.pdf

TCPDF does not support incremental update. See the help forum question:

https://sourceforge.net/p/tcpdf/discussion/435311/thread/8cf24d19/

You need to use a library that supports incremental update. Once such library is SignPDF from NodeJS world. Here is the issue ticket that's been discussed multiple signatures. Maybe you can have this as a back-end service just for applying signatures for this portion of your app.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...