3

I am attempting to digitally sign a pdf document while still allowing for the modification of annotations and allowing the adding and removing of pages using itextsharp, Version=4.1.6.0. Below is my current code:

var signatureStamper = PdfStamper.CreateSignature(pdfReader, memoryStream, '\0', null);
signatureStamper.SetEncryption(null, Encoding.UTF8.GetBytes(certificationBundle.Password), PdfWriter.ALLOW_PRINTING | PdfWriter.ALLOW_MODIFY_ANNOTATIONS | PdfWriter.AllowAssembly, PdfWriter.STANDARD_ENCRYPTION_128);

With this configuration however, I am still unable to add and remove pages. Am I Using PdfWriter.AllowAssembly incorrectly?

jth41
  • 3,808
  • 9
  • 59
  • 109

1 Answers1

2

I am attempting to digitally sign a pdf document while still allowing for the modification of annotations and allowing the adding and removing of pages

Addition or removal of pages is never allowed for signed documents, cf. this stack overflow answer. At most you are allowed to do the following:

  • Adding signature fields

  • Adding or editing annotations

  • Supplying form field values

  • Digitally signing

Community
  • 1
  • 1
mkl
  • 90,588
  • 15
  • 125
  • 265