Page 1 of 1

Modify signed PDF without compromising the signature

Posted: Mon Jan 02, 2017 1:03 pm
by nenea
Hi all,
I'm trying to edit a signed PDF without compromising the signature.

In Adobe Acrobat Reader I'm able to insert a note in the signed PDF without compromising the signature (Acrobat Reader gives a warning reporting that the note has been inserted after the signature).

I tried to modify the PDF using GDPicture (code below), but Acrobat Reader reports an error in the signature after doing that.

Is there a way to add annotation to the signed PDF as Acrobat Reader does ?

Code: Select all

GdPicturePDF oGdPicturePDF = new GdPicturePDF();
oGdPicturePDF.LoadFromFile(myFile, true);
string font_res_name = oGdPicturePDF.AddTrueTypeFont("Arial", false, false, false);
oGdPicturePDF.SetFillColor(255, 0, 0, 0); 
oGdPicturePDF.DrawText(font_res_name, 1, 1, "Hello World!");
oGdPicturePDF.SaveToFile(_fileSelezionato.ToUpper().Replace(".PDF", "_modified.PDF"));

Re: Modify signed PDF without compromising the signature

Posted: Tue Jan 03, 2017 11:54 am
by delbeke
Hi Nenea

First of all, happy new year.

You can modify a signed pdf as far you save the modifications with an incremental save method.
see : ... leInc.html

The modifications are added at the end of the file, letting the old signatures unchanged.

Hope these help.

Best regards

Re: Modify signed PDF without compromising the signature

Posted: Thu Jan 05, 2017 3:26 pm
by nenea
Hi Jean-Luc, happy new year!

Using the SaveToFileInc method could be ok, but if I open the resulting file with Acrobat Reader, I receive an error, even if I can recover the properly signed version of the file.

Is there a method to add an annotation to the PDF file?


Re: Modify signed PDF without compromising the signature

Posted: Fri Jan 06, 2017 11:17 am
by delbeke

If you want to modify a signed pdf, the first signature must be a certification signature (it contains a DocMDP entry).

see : ... in_PDF.pdf
chapter 6.3.11

A document can contain only one signature field that contains a DocMDP transform method, and it must be the first signed field in the document. That signature is called a “certification” signature. This feature enables the author to specify what changes are permitted and what changes invalidate the author’s signature. However, most users will perceive the effect of DocMDP as specifying what they can do to a document.

As far you are not the first signer of the pdf, you can not do better.

Hope this help.
Best regards.

Re: Modify signed PDF without compromising the signature

Posted: Tue May 08, 2018 1:37 pm
by avalon86
What can I say, that's the key point of Acrobat. I tried to combine that with GDP as well, but I barely could count all the times it let me down. No I'm done with Adobe's thing for good, but you may consider to try to keep modifying your files and to fix the signature issue then? Yes, quite a solution, but either way, it's better than nothing. Or you should try some other tool instead of Acrobat XI, actually me using this one: It allows to do all the required edits with pdf's, such as to replace fonts, add watermark or signatures, obviously. Furthermore, this one is free and works as web application fine, so all you need here is up-to-dated browser version. Haven't tried to compare it with gdpicture yet, but don't think of it as anything challenging

Re: Modify signed PDF without compromising the signature

Posted: Thu May 10, 2018 8:27 am
by delbeke
Hi avalon86
The minimum to change a signed pdf without invalidating the signature, is to use an incremental save.
use the SaveToFileInc function for example
see : ... leInc.html

Hope this help