buba
buba

Reputation: 59

Write digital signature in all .pdf files

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

Answers (1)

Tharif
Tharif

Reputation: 13971

Like conventional handwritten signatures, digital signatures uniquely identify a person or entity signing a document.

How to sign using Adobe® Acrobat® XI is described in the pdf

To sign using C# application please refer this.

Upvotes: 1

Related Questions