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.

Mon Oct 12, 2020 4:09 pm

Hi!

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;
                }
            }

fletchsod
 
Posts: 3
Joined: Mon Oct 12, 2020 3:31 pm

Tue Oct 13, 2020 9:07 am

Hello,

Thanks for your inquiry.
Yes, at present our Spire.PDF does not support setting the Export value of the checkbox field. We have added it as a new feature to our upgrade list with the ticket SPIREPDF-3675. If it is implemented in the future, we will let you know.
As for the background color issue, I did notice that it did not work. I have logged it in our bug tracking system with the ticket SPIREPDF-3676. We will inform you if there is any update. Sorry for the inconvenience caused.

Sincerely,
Elena
E-iceblue support team
User avatar

Elena.Zhang
 
Posts: 279
Joined: Thu Jul 23, 2020 1:18 am

Wed Apr 14, 2021 10:02 am

Hello,

Greetings from E-iceblue!
Glad to inform you that we just released Spire.PDF Pack(Hot Fix) Version:7.4.5 which fixes your issue SPIREPDF-3675, please download it from the following links to test on your side. Looking forward to your testing result.
Website link: https://www.e-iceblue.com/Download/down ... t-now.html
Nuget link: https://www.nuget.org/packages/Spire.PDF/7.4.5

Sincerely,
Brian
E-iceblue support team
User avatar

Brian.Li
 
Posts: 1271
Joined: Mon Oct 19, 2020 3:04 am

Return to Spire.PDF

cron