[英]Write digital signature in all .pdf files
我一直在使用Web表单,现在我的任务是使winForm能够读取一个文件夹中的所有.pdf文件并为他实现数字签名。我具有扩展名为.pfx的数字签名。我有以下代码,但是我不知道如何使用它,因为我对此很陌生。请帮助我!-感谢您的帮助。 我需要所有Windows窗体,因为我不知道该怎么做。
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();
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.