I am interested in buying the Adobe.PDF product for .NET and at the moment i am trying to fill a simple scenario of a PDF document using the FillField() method.
Text-boxes are filled up correctly but check-boxes are not. I tried all these methods but none of them works:
form.FillField(“Check_box1”, True)
form.FillField(“Check_box1”, “Yes”)
form.FillField(“Check_box1”, “On”)
The fields are named as follows:
Textbox_1
Textbox_2
Check_box1
Check_box2
Can you please tell me what is wrong and how I can fix this?
NB: Attached please find the PDF document I am using. I am also using the evaluation license and I downloaded the Aspose.Pdf for .NET 7.2.0 (DLLs only).
I have tested your issue with the Aspose.Pdf for .NET v7.2 using your template file and I am able to check the checkbox fields. Following is my sample code:
//open document
Aspose.Pdf.Facades.Form pdfForm = new Aspose.Pdf.Facades.Form(@"D:\TestPDFForm.pdf", @"D:\TestPDFForm_output.pdf");
//Check the Checkbox field
pdfForm.FillField("Check_Box1", true);
//save updated PDF
pdfForm.Save();
Please share your sample code with us to show us the issue.
I noticed that there is a small issue in your code. You are using the field name as “Check_box1” instead of “Check_Box1” (B should be in capital) which is causing the problem. Please update your code and it will work fine.