Reputation: 59
All the time I was working with web forms, now I have task to make winForm who will read all .pdf files in one folder and implement to him a digital signature.I have that digital signature with extension .pfx.I have following code, but I don't know how to use it, because I'm really new to this.Please help me!-I appreciate your help. I need all windows form because I don't know how that funkcionate.
PdfFileSignature pdfSign = new PdfFileSignature("input.pdf", "output.pdf");
System.Drawing.Rectangle rect = new System.Drawing.Rectangle(100, 100, 200, 100);
pdfSign.SignatureAppearance = "butterfly.jpg";
PKCS1 signature = new PKCS1("test.pfx", "password"); // PKCS#1 or
//PKCS7 signature = new PKCS7("test.pfx", "password"); // PKCS#7 or
//PKCS7Detached signature = new PKCS7Detached("test.pfx", "password"); // PKCS#7 detached
pdfSign.Sign(1, "Signature Reason", "Contact", "Location", true, rect, signature);
//save output PDF file
pdfSign.Save();
Upvotes: 0
Views: 1053