There are two types of digital
signatures in a PDF.Author
Signature : Zero or OneApproval/Recipient
Signatures : Zero to Many
static bool CertifyPDF() // shows adding Author signature (can only call once on a document)static bool SignPDF() // shows adding an Approval signature (you can have as many of these as you want)
In particular, the Author Signature is indicated by the DocMDP entry. You can only have one of these, and it
must be the first signature.
The Approval signatures are always associated with Field/Widget. While Author signatures should also be associated with a Widget (though not a field) on the any page (1st is probably the best). This way the signature will appear in the Adobe Acrobat UI. The Rect of the Widgets (for both Approval and Author signatures) can be zero area if you don't want to show anything graphical. Adobe Acrobat will only enumerate and display signatures in
the user interface that are part of Widget annotation.
So, in short, you can have multiple signatures, but only one can be
DocMDP/Author signature. The rest must be Approval signatures (which
should be associated with a Signature Field. Note, the DocMDP one should
also be associated with a Field and Widget, but the widget should have a
Note that the actual digital signature calculation occurs at the time of saving.
Furthermore, to add additional signatures you need to save incrementally, so as not to modify the original data and therefore accidentally invalidate the previous signature(s).
So after opening a file, but before adding your own signature, you can check for a digital signature.
PDFDoc doc = new PDFDoc(path);
bool has_sigs_and_needs_incremental_save = doc.HasSignatures();
Finally, if you want to do multiple signatures in a row, you need to re-open the file after each save. See this post for more.