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 Sep 01, 2014 1:47 am

Hello,

I am trying to fill an XFA type form using the Free Spire.PDF for .NET. The program works fine with the trial version of Spire.PDF for .NET. However, when using the Free version, the fields do not have the data.

The following is a snippet:

Code: Select all
            PdfDocument doc = new PdfDocument();
            string dataDir = "D:/PDFTemplates/";
            doc.LoadFromFile(dataDir + "LCD_XFA_Form.pdf");

            PdfFormWidget formWidget = doc.Form as PdfFormWidget;
            for (int i = 0; i < formWidget.FieldsWidget.List.Count; i++)
            {
                PdfField field = formWidget.FieldsWidget.List[i] as PdfField;

                if (field is PdfTextBoxFieldWidget)
                {
                    PdfTextBoxFieldWidget textBoxField = field as PdfTextBoxFieldWidget;
                    switch (textBoxField.Name)
                    {
                        case "topmostSubform[0].Page1[0].Name[0]":
                            textBoxField.Text = "Someone";
                            break;
                        case "topmostSubform[0].Page1[0].ParcelID[0]":
                            textBoxField.Text = "1234-567";
                            break;
                    }

                }
                field.Flatten = true;
            }

            var saveFile = dataDir + "/test.pdf";
            doc.SaveToFile(saveFile);
            System.Diagnostics.Process.Start(saveFile);


Any assistance would be greatly appreciated!

hughesd
 
Posts: 2
Joined: Sun Aug 31, 2014 10:42 pm

Mon Sep 01, 2014 2:25 am

Dear hughesd,

Thanks for your inquiry.

Please send us your "LCD_XFA_Form.pdf" to help us resolve your problem.
Thanks.

Best regards,
Burning
E-iceblue Support Team
Best Regards,
Burning
E-iceblue Support Team
User avatar

burning.liu
 
Posts: 406
Joined: Mon Aug 04, 2014 6:47 am

Mon Sep 01, 2014 4:44 pm

Hello Burning,

Thank you for the quick response!

Attached is a copy of the LCD_XFA_Form.pdf.

Thank you in advance for your assistance!

hughesd
 
Posts: 2
Joined: Sun Aug 31, 2014 10:42 pm

Tue Sep 02, 2014 3:35 am

Dear hughesd,

Thanks for your inquiry.
Sorry for the problem you encountered that might block you some times.
And I have posted this issue to our dev team. We will inform you as soon as it is resolved.

Best regards,
Burning
E-iceblue Support Team
Best Regards,
Burning
E-iceblue Support Team
User avatar

burning.liu
 
Posts: 406
Joined: Mon Aug 04, 2014 6:47 am

Return to Spire.PDF