Incremental PDF saving for digital signatures


I try to sign a PDF document with two or more signatures in my solution. It seems that Acrobat does not support adding multiple signatures in a single shot.

Looking inside the PDF signed with third party solutions, I see that PDF document, in case of most existing solutions is is saved via incremental updates. Each signature part is added at the end of document, that is, previous pdf is not changed, and you see different EOF inside the document, according to the different updates.

If i try to save document with your routine,
doc.Save(PDFName, SDFDoc.SaveOptions.e_compatibility | SDFDoc.SaveOptions.e_incremental);

we found only one EOF, and some field in the “original” document are changed.

so my question is: it is possible to have PDF saved in a incremental mode such as the previous part of document remains unchanged ?


Yes, you can incrementally save PDF. There are some constraints thought:

  1. The file must saved on the same location as the original file. For example:
    PDFDoc doc("/home/pdftron/MyFile.pdf");
    doc.Save("/home/pdftron/MyFile.pdf", SDFDoc::e_incremental);

  2. The original file’s security handler must not be modified.

  3. Use e_incremental save flag. Also SDFDoc::e_linearized must not be used.