tecnickcom / TCPDF

Official clone of PHP library to generate PDF documents and barcodes
https://tcpdf.org
Other
4.13k stars 1.51k forks source link

Stamp included to PDF using setSignatureAppearance #673

Open josevavia opened 8 months ago

josevavia commented 8 months ago

When using setSignatureAppearance method (in addition to setSignature), the resultant PDF has a "stamp" included that is shown as a cross line in some PDF viewers, like "pdf reader: edit & convert pdf" in MacOS:

image

Same file opened in Acrobat Reader:

image

And an empty PDF including a "stamp" created from Adobe Reader, without signatures, opened in "pdf reader: edit & convert pdf"

Captura de Pantalla 2023-12-29 a las 14 18 32

I think that the problem is that when we call the method setSignatureAppearance, the resultant PDF has both the signature reference in the rectangle and a stamp included in this area.

I was doing some research and saw the code generated by TCPDF, compared to PDF files signed using Adobe Acrobat Reader (those do not generate a "stamp"), but I could not find anything useful

Anyone know how to prevent TCPDF having this behavior? What is the PDF command that causes the "stamp" to appear?

williamdes commented 7 months ago

Hello !

This is a very well written post, thank you !

Anyone know how to prevent TCPDF having this behavior? What is the PDF command that causes the "stamp" to appear?

I think websites like StackOverflow would maybe help better, here there is not much support except for very explicit bugs

Let us know if you find something

josevavia commented 7 months ago

After a lot of research, and some kind of reverse engineering, I can not find anything usefull.

It seems to be related to the way that this reader "pdf reader: edit & convert pdf" interprets the signature and seal fields.

I would like to know what is the field o code that causes this, but was impossible to me :(