Populating checkboxes with AutoFiller

Hello,

I’m using AutoFiller to populate a PDF form, and it all works quite nicely but I’m having a little trouble with checkbox fields. The problem is that if the data I’m using to populate the checkbox (so it’s either checked or not checked) contains a space, the checkbox field doesn’t work. (It works fine if the data doesn’t contain a space.)

For example, say I have a checkbox field called:
“OpportunityStatus” and the expression to evaluate is “Closed”.

If my data table has:

DataTable dt = new DataTable(“Opportunities”);
dt.Columns.Add(new DataColumn(“OpportunityStatus”);
DataRow dr = dt.NewRow();
dr[“OpportunityStatus”] = “Closed”;

When I use AutoFiller with this data and the field described, the checkbox will come out checked.

If, however, I change the data to:
dr[“OpportunityStatus”] = “Closed Won”, and make the corresponding change to the PDF form field (to evaluate to “Closed Won”), the checkbox field doesn’t come out checked.

Do you have a suggestion on how to get this to work?

Thanks
Mike

Hello Mike,

Sorry for delay in response. I have checked the scenario and have discussed it with the development team. Soon you will be updated with the status. We apologies for the inconvenience.

Hello Mike,

Thanks for considering our product.

Please upload your resources so we can reproduce the problem and check it for you. If you don't want anybody else see it, my mailbox: luke.fu@aspose.com.

Thx.

Here you go, Luke. I’ve attached the simple code and the PDF Template:


protected void Button1_Click(object sender, EventArgs e)
{
DataTable dt = new DataTable(“Projects”);
dt.Columns.Add(new DataColumn(“Status”));
dt.Columns.Add(new DataColumn(“StatusWithSpace”));
DataRow dr = dt.NewRow();
dr[“Status”] = “Active”;
dr[“StatusWithSpace”] = “In Progress”;
dt.Rows.Add(dr);

AutoFiller autoFiller = new AutoFiller();
autoFiller.InputFileName = @“C:\Checkbox Template.pdf”;
autoFiller.OutputStream = Response.OutputStream;

autoFiller.ImportDataTable(dt);
autoFiller.Save();

}

Dear Mike,

This issue has been registered as [PDFKITNET-5534]. It will be resolved in two weeks.

Best regards.

Thanks Luke. Looking forward to it.

Luke,

It looks like the correction for this didn’t make it into the new 3.2.0.0 version, right? I didn’t try it, but I don’t see it listed in the Revision History. Any news on this?

Mike

Hello Mike, <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

I am pleased to inform you that PDFKITNET-5534 has been resolved in Aspose.Pdf.Kit v3.2.0.0. You can test it using the code snippet and the pdf file that you have shared with in this thread.

In case of any further issues, please feel free to share.

That’s great news… many thanks.

Mike