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.

Fri Jun 02, 2023 3:41 pm

I am trying to flattern the PDF with four pages. Ist page field values are coming correctly. But rest of the page field widgets are coming as blank. Values are not coming as expected.
Kinldy help to get widget values. Please refer the attached screen shot which i debugged in .net C# code.

Spire.Pdf.PdfDocument

Dll name : Spire.Pdf.dll
.Net Framework 4.8
Operating system : windows 10
Application Type : .Net Framework 4.5

revathipurushoth
 
Posts: 1
Joined: Fri Jun 02, 2023 2:56 pm

Mon Jun 05, 2023 6:30 am

Hello,

Thanks for your inquiry.
To facilitate problem reproduction, please provide us with your source PDF document(If it's not convenient, you can provide us with a simplified version of the document). Also, since your provided code contains many other classes and parameters that we cannot simulate, could you kindly provide a simple demo for us to test? You could attach them here or send them to us via email (support@e-iceblue.com). Thanks in advance.

Sincerely
Wenly
E-iceblue support team
User avatar

Wenly.Zhang
 
Posts: 149
Joined: Tue May 16, 2023 2:19 am

Tue Jun 06, 2023 7:04 am

Hi,

Thanks for sharing the information via email.
I tested your sample code and did reproduce the issue you mentioned. After investigation, we found that most of the text box fields in your source PDF document were not filled with values. We tested your document using the code below, and the result indicated that we could correctly retrieve the values of text box fields that had been filled with text. We suggest that you use the latest version of Spire.PDF(Spire.PDF Pack(Hot Fix) Version:9.6.0) for testing first. Looking forward to your test feedback.
Code: Select all
            StringBuilder sb = new StringBuilder();
            string input = "Sample.pdf";
            PdfDocument doc = new PdfDocument();
            doc.LoadFromFile(input);
            //Get PDF Form Object
            PdfFormWidget formWidget = doc.Form as PdfFormWidget;
            //traversal
            for (int i = 0; i < formWidget.FieldsWidget.List.Count; i++)
            {
                PdfField field = formWidget.FieldsWidget.List[i] as PdfField;
                //Check whether the specified form field is a text box
                if (field is PdfTextBoxFieldWidget)
                {
                    PdfTextBoxFieldWidget textBoxField = field as PdfTextBoxFieldWidget;
                    //Get text of textbox
                    string text = textBoxField.Text;
                    sb.Append(textBoxField.Name+" ====> " + text + "\r\n");
                }
            }
            //Write all fields and their values in the source document to a text document
            string result = "result.txt";
            File.WriteAllText(result, sb.ToString());


Sincerely
Wenly
E-iceblue support team
User avatar

Wenly.Zhang
 
Posts: 149
Joined: Tue May 16, 2023 2:19 am

Thu Jun 08, 2023 7:42 am

Hi,

Thanks for sharing the information via email.
I have tested with the file and code provided by you, and did reproduce the issue you mentioned. I have logged the issue into our bug tracking system with the ticket number SPIREPDF-6041. Our development team will investigate and fix it. Once it is resolved, I will inform you in time. Sorry for the inconvenience caused.

Sincerely,
Wenly
E-iceblue support team
User avatar

Wenly.Zhang
 
Posts: 149
Joined: Tue May 16, 2023 2:19 am

Fri Dec 08, 2023 9:44 am

Hello,

Thanks for your patience.
Glad to inform the issue of SPIREPDF-6041 has been resolved and the hotfix Spire.PDF 9.12.0 version is available now. Welcome to test it.

Sincerely,
Lisa
E-iceblue support team
User avatar

Lisa.Li
 
Posts: 1271
Joined: Wed Apr 25, 2018 3:20 am

Return to Spire.PDF