SHARE
TWEET

Untitled

a guest Jun 26th, 2019 51 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public void Sign(string SigReason, string SigContact, string SigLocation, bool visible)
  2.         {
  3.             PdfReader reader = new PdfReader(this.inputPDF);
  4. /*ERROR-->*/PdfEncryptor.Encrypt(reader, new FileStream(this.outputPDF, FileMode.Create, FileAccess.Write), true, null, null, PdfWriter.AllowFillIn | PdfWriter.AllowScreenReaders);
  5.             PdfStamper st = PdfStamper.CreateSignature(reader, new FileStream(this.outputPDF, FileMode.Create, FileAccess.Write), '', null, true);
  6.             st.MoreInfo = this.metadata.getMetaData();
  7.             st.XmpMetadata = this.metadata.getStreamedMetaData();
  8.             PdfSignatureAppearance sap = st.SignatureAppearance;
  9.  
  10.             sap.SetCrypto(this.myCert.Akp, this.myCert.Chain, null, PdfSignatureAppearance.WINCER_SIGNED);
  11.             sap.Reason = SigReason;
  12.             sap.Contact = SigContact;
  13.             sap.Location = SigLocation;
  14.  
  15.             if (visible)
  16.                 sap.SetVisibleSignature(new iTextSharp.text.Rectangle(100, 100, 250, 150), 1, null);
  17.  
  18.             st.Close();
  19.  
  20.         }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top