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 04, 2014 9:32 pm

No errors but form fields text not saving on new doc. See code:

private void btnCreate_Click(object sender, EventArgs e)
{
//Get Local Path
string path = Directory.GetCurrentDirectory();
//
//Get Orig Pdf
PdfDocument doc = new PdfDocument();
doc.LoadFromFile(path + "\\Test.pdf");
//
//Mark Up Form Fields
PdfFormWidget formWidget = doc.Form as PdfFormWidget;
for (int i = 0; i < formWidget.FieldsWidget.List.Count; i++)
{
PdfField field = formWidget.FieldsWidget.List[i] as PdfField;
if (field is PdfTextBoxFieldWidget)
{
PdfTextBoxFieldWidget textBoxField = field as PdfTextBoxFieldWidget;
switch (textBoxField.Name)
{
case "Text1":
textBoxField.Text = "derp text one"; //Gets here but does not save
break;
case "text2":
textBoxField.Text = "derp text two"; //Gets here but does not save
break;
case "Text3":
textBoxField.Text = "derp text three"; //Gets here but does not save
break;
}
}
}
//
//Save
doc.SaveToFile(path + "\\derp.pdf");
//
//
//
//MessageBox.Show("All done derping.");
}

joey0129
 
Posts: 5
Joined: Wed Dec 03, 2014 3:36 pm

Fri Dec 05, 2014 2:19 am

Dear joey0129,

Thanks for your inquiry.

To help us reproduce this issue, please upload "Test.pdf" to the forum, or you can sent it to burning.liu@e-iceblue.com.
Best Regards,
Burning
E-iceblue Support Team
User avatar

burning.liu
 
Posts: 406
Joined: Mon Aug 04, 2014 6:47 am

Fri Dec 05, 2014 3:10 pm

Here is a zipped copy of the test.pdf.

Also, I see that:
case "text2":
should be:
case "Text2":

Looking forward to your input.

joey0129
 
Posts: 5
Joined: Wed Dec 03, 2014 3:36 pm

Mon Dec 08, 2014 4:01 am

Dear joey0129,

Sorry for the delay reply.

I used Spire.PDF Pack Version:3.2.0 to do fill form fields with your "Test.pdf" and it worked well, please try that:
http://www.e-iceblue.com/downloads/spire.pdf_3.2.0.zip
Best Regards,
Burning
E-iceblue Support Team
User avatar

burning.liu
 
Posts: 406
Joined: Mon Aug 04, 2014 6:47 am

Mon Dec 08, 2014 4:01 pm

I was able to get this to work with version 3.2.

Is it available in the free version?

joey0129
 
Posts: 5
Joined: Wed Dec 03, 2014 3:36 pm

Tue Dec 09, 2014 1:30 am

Dear joey0129,

After testing with Free Spire.PDF, I found it doesn't work at all when fill form fields. So I posted this issue to our dev team, we will inform you if there is any update.
Best Regards,
Burning
E-iceblue Support Team
User avatar

burning.liu
 
Posts: 406
Joined: Mon Aug 04, 2014 6:47 am

Wed Dec 10, 2014 9:46 pm

Hope to see it fixed.

joey0129
 
Posts: 5
Joined: Wed Dec 03, 2014 3:36 pm

Fri Dec 12, 2014 8:16 am

Dear joey0129,

Since we only maintain our free version when we have enough time, therefore, I recommend you to use Spire.PDF v3.2.0 to do fill form fields, but we will inform you when it is resolved in the free version.
Best Regards,
Burning
E-iceblue Support Team
User avatar

burning.liu
 
Posts: 406
Joined: Mon Aug 04, 2014 6:47 am

Thu Jan 21, 2021 8:10 am

Dear joey0129,

Sorry for the long silence.

Glad to inform that your issue has been solved.

Welcome to download and test the latest Free Spire.PDF for .NET v6.10 from the following links.
Website link: https://www.e-iceblue.com/Download/download-pdf-for-net-free.html
Nuget link: https://www.nuget.org/packages/FreeSpire.PDF/6.10.6

If you encounter any issues related to our product in the future, just feel free to contact us.

Sincerely,
Marcia
E-iceblue support team
User avatar

Marcia.Zhou
 
Posts: 858
Joined: Wed Nov 04, 2020 2:29 am

Return to Spire.PDF