My team came across your product & we're evaluating it. We had burned through 8 different PDF softwares & can't use it due to bugs. We're already exhausted looking for something that works with no bugs.
We're using NuGet package here --> "<package id="Spire.PDF" version="6.10.0" targetFramework="net472" />".
In Adobe Professional, my support team programmed over 100 new PDF & the sticking point here is the checkbox. In the checkbox property, we use export value of 1, 2, 3, 4, 5, yes or no. But this Spire PDF.NET checkbox doesn't have "value" property but "checked" property. If you go to Adobe Professional & create a checkbox there, then double click it to bring up checkbox properties then you'll see the Export Value there. See the attached file for checkbox properties.
We have some checkboxes w/ same field name which is the reason for the Export value.
So how do we correctly set the checkbox value? We also noticed setting the background color doesn't work either. Here's the code below
- Code: Select all
pdfDocument.LoadFromStream(pdfFileStream);
var formWidgets = pdfDocument.Form as PdfFormWidget;
for (int formWidgetIndex = 0; formWidgetIndex < formWidgets.FieldsWidget.List.Count; formWidgetIndex++)
{
var pdfField = formWidgets.FieldsWidget.List[formWidgetIndex] as PdfField;
var fieldName = pdfField.Name;
var fieldValue = "yes";
if (pdfField is PdfTextBoxFieldWidget)
{
var textBoxField = pdfField as PdfTextBoxFieldWidget;
if (fieldValue.StartsWith(@"\")) // Only flatten DocuSign fields.
{
textBoxField.Text = fieldValue;
textBoxField.ReadOnly = true;
textBoxField.Flatten = true;
textBoxField.ForeColor = dotnetDrawing::Color.White;
}
else
{
textBoxField.Text = fieldValue;
}
//textBoxField.BorderStyle = PdfBorderStyle.Solid;
textBoxField.BorderWidth = 0f;
textBoxField.BorderColor = dotnetDrawing::Color.White;
textBoxField.BackColor = dotnetDrawing::Color.White;
}
else if (pdfField is PdfCheckBoxWidgetFieldWidget)
{
var checkBoxField = pdfField as PdfCheckBoxWidgetFieldWidget;
checkBoxField.Checked = EvaluatePdfCheckboxField(checkBoxField, fieldValue);
//checkBoxField.BorderStyle = PdfBorderStyle.Solid;
checkBoxField.BorderWidth = 0f;
checkBoxField.BorderColor = dotnetDrawing::Color.White;
checkBoxField.BackColor = dotnetDrawing::Color.White;
}
}