You can set the x and y positions according to your requirements. To set up the appearance of the digital signature, we'll use the PdfSignatureAppearance class. PdfStamper pdfStamper = PdfStamper.CreateSignature(pdfReader, new FileStream("C:\\Users\\Admin\\Documents\\MyPDF_Signed.pdf", FileMode.Create), '\0', null, true) We'll initialize a PdfStamper object, which allows us to add content to the PDF. Pkcs12Store pfxKeyStore = new Pkcs12Store(new FileStream(pfxFilePath, FileMode.Open, FileAccess.Read), pfxPassword.ToCharArray()) Step 4. Initialize the PDF Stamper And Create the Signature Appearance string pfxFilePath = "D:\\Uday Dodiya\\Digital_Sign\\Uday Dodiya.pfx" Load the PFX certificate file that contains your digital signature and also give the password for your digital signature. PdfReader pdfReader = new PdfReader(pdfFilePath) Step 3. Loading the Digital Certificate string pdfFilePath = "C:\\Users\\Admin\\Documents\\MyPDF.pdf" Load the PDF document that you want to sign using PdfReader. Create a project and install the libraryĬreate a new C# project in your preferred development environment and Install the iTextSharp library using NuGet to enable PDF manipulation. This helps make sure your digital papers are real and trustworthy. In this article, we'll learn how to put a digital stamp on a PDF using iTextSharp in C#. Adding a digital signature to a PDF is like giving it a special digital stamp that ensures it's real, safe, and from the right person.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |