Spire.PDF is a professional PDF library applied to creating, writing, editing, handling and reading PDF files without any external dependencies. Get free and professional technical support for Spire.PDF for .NET, Java, Android, C++, Python.

Thu Dec 22, 2016 12:49 pm

Hello,

I am writing this post due to my company is evaluating your software to see if it fits with a product we are developing. My questions are:
1. I have a pdf form with various text fields that populates with data and the issues that I am having is writing an electronic signature to the signature fields in the PDF form. I tried your example and created a .pfx file for the my signature when I am debugging I see the information in the pfx, but it doesn't append the signature to the text field in the PDF document.

2. Are there ways of disabling various text fields before the document is signed.

This is a concern and depends a great amount on the determination that I review to my company on whether to purchase this product verses another product

tgauden
 
Posts: 1
Joined: Thu Dec 01, 2016 4:35 pm

Fri Dec 23, 2016 3:35 am

Dear tgauden,

Thanks for your inquiry.
Here is sample code for your reference.
Code: Select all
            PdfDocument doc = new PdfDocument();
            doc.LoadFromFile(@"F:\testing\pdf form testing\original document\9419.pdf");
            PdfPageBase page = doc.Pages[0];
            String pfxPath = @"gary.pfx";
            PdfCertificate digi = new PdfCertificate(pfxPath, "e-iceblue"); 
            //get the PDF form.         
            var form = (PdfFormWidget)doc.Form;
            //question 2, flatten the textbox field
            PdfTextBoxFieldWidget textBoxField = form.FieldsWidget[1] as PdfTextBoxFieldWidget;
            textBoxField.Flatten = true;
            //question 1, add the signature into signature field.
            var field = form.FieldsWidget[0] as PdfSignatureFieldWidget;
            PdfSignature signature = new PdfSignature(doc, page, digi, "demo", field);           
           doc.SaveToFile("9419.pdf");

Hope this can help you. If there still is issue, please provide us sample file for further investigation.

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Tue Dec 27, 2016 6:24 am

Dear tgauden,

Did you test the code I provided ? Has your issue been resolved ?
If not, please provide us sample file for further investigation.

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Return to Spire.PDF

cron