Populate XFA Form Fields Values in PDF Document using Aspose.PDF

Hi,
I am working on a project and looking to buy something to populate PDF form for my client.
I tried to use ASPOSE PDF to populate fields on a government form, but it does not work for all fields. I believe this form is created by LiveCycle and user can add section to the PDF dynamically.
I was able to extract all field names using the script below:

var allFields = “”;

for (var i = 0; i < this.numFields; i++)
{
var newField = ‘"’ + this.getNthFieldName(i) + '" ';
allFields += newField;
}
app.alert(allFields);

But the problem is some fields cannot be populated, e.g.: form1[0].page2[0].householdMember[1].memberLastName[0]
form1[0].page2[0].householdMember[2].memberLastName[0]

Here is the url to download the form. It’s a government form:

Thanks,
Wesley

@WesleyF

Thank you for contacting support.

Would you please share the code which you are using to populate the fields in your environment, along with generated PDF document so that we may investigate further to help you out.

Hi Farhan,
I am still investigating and see if it’s possible to populate this PDF form. My code is really simple, just trying to populate some values into fields and see if the code is working. Here is my code:

Aspose.Pdf.Facades.Form form = new Aspose.Pdf.Facades.Form(“C:\temp\TempProject\PDFTest\PDFTest\PDF\Trillium Application Form.pdf”);

        string aaa = form.FieldNames.ToString();

        form.FillField("form1[0].page1[0].section2[0].contactPerson[0].lastName[0]", "last name test");

        //form.FillField("form1[0].page1[0].section2[0].contactPerson[0].#subform[0].gender[0]", "Male");
        form.FillField("form1[0].page1[0].section2[0].contactPerson[0].#subform[0].gender[0]", "Female");

        form.FillField("form1[0].page1[0].section2[0].contactPerson[0].MailingAddress[0].StreetName[0]", "mailing address test");
        form.FillField("form1[0].page1[0].section2[0].contactPerson[0].residentialAddress[0].StreetName[0]", "residential address test");
        form.FillField("form1[0].page2[0].householdMember[0].memberLastName[0]", "member 1 last name");
        form.FillField("form1[0].page2[0].householdMember[1].memberLastName[0]", "member 2 last name");
        form.FillField("form1[0].page2[0].householdMember[2].memberLastName[0]", "member 3 last name");
        form.FillField("form1[0].page2[0].section3[0].insurance[0].insurancePlan[0].phLastName[0]", "insurance plan ph last name");

        //form.FillField("form1[0].page2[0].section3[0].drug[0].sub[0].radio[0].Yes[0]", true);

        form.FillField("form1[0].page2[0].section3[0].drug[0].sub[0].radio[0]", "Yes");

       
        form.Save("C:\\temp\\TempProject\\PDFTest\\PDFTest\\PDF\\Trillium Application Form_TryFill.pdf");

Here is the original document I downloaded from the government website: Trillium Application Form_Original.pdf (1.6 MB)

Here is the one I populated: Trillium Application Form_TryFill.pdf (1.6 MB)

I also noticed when I open the one I populated, I got a message and it said the document has been changed and extended feature is no long available. Is it possible to use ASPOSE.PDF to populate PDF without modifying the document?

Thanks,
Wesley

@WesleyF

A ticket with ID PDFNET-45772 has been logged in our issue management system for further investigation and resolution. The ticket ID has been linked with this thread so that you will receive notification as soon as the ticket is resolved.

To preserve extended features, you may use incremental approach as explained in Preserve Extended Rights when Working with Forms

We are sorry for the inconvenience.

Hi,
I just want to follow up on this post. I haven’t received any email for ticket PDFNET-45772. Can I have an update, please?

Thanks,
Wesley

@WesleyF

Thank you for getting back to us.

We are afraid this issue is currently pending owing to previously logged tickets. It will be scheduled on its due turn which may take some months. We will let you know as soon as some significant updates will be available. We appreciate your patience and comprehension in this regard.

However, we also offer Paid Support, where issues are used to be investigated with higher priority. Our customers, who have paid support subscription, report their issue there which are meant to be investigated urgently. In case your reported issue is a blocker, you may please consider subscribing for Paid Support. For further information, please visit Paid Support FAQs.