We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Populate fields of an XFA Pdf

I am trying to use Aspose.Pdf.Kit to populate an XFA PDF File (PDF Version 1.7 build by LiveCycle Designer 8.0)

I create a Form.

I got the fields name from the attribute array FieldsNames (typically "formulaire1[0].#subform[0].Champ_de_texte1[0]").

I populate them with FillFiled (, ).

I save the form.

When I try to open the updated pdf file (Acrobat Reader 9) I got a message "Bad Expression SOM..." and Acrobat Reader crashes...

Any help ?

Hi Philippe,

Please share the PDF file and the code snippet you’re using at your end. We’ll test the issue at our end and try to find out the cause of this problem. We’ll update you with the resolution accordingly.

We’re sorry for the inconvenience.
Regards,

Here is the zip fil with :

- the .cs used tp create the updated file

- the input file (F14.pdf)

- the output file (F14_updated.pdf)

Hi Philippe,

I have reproduced the problem at my end and logged it as PDFKITNET-12596 in our issue tracking system. Our team will be looking into this matter and you’ll be updated via this forum, once the issue is resolved.

We’re sorry for the inconvenience.
Regards,

The issues you have found earlier (filed as 12596) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.

I have installed the update, rebuilt my sample, and ran it.

The result fil e(F14_updated) can be opened (that was not possible with old version), but no field is updated.

What is wrong ?

PhM

Hi Philippe,

You also need to adjust the form field names while filling the form; please use the form field names as shown below:

form.FillField(“Champ_de_texte1”, “sample text”);
form.FillField(“Champ_de_texte2”, “sample text”);

I hope this helps. If you still find any issue or have some more questions, please do let us know.
Regards,


I wrote this :

String[] allfields = form.FieldsNames;

for (int i = 0; i < allfields.Length; i++)

{

form.FillField(allfields [i], ("12345"));

}

form.Save();

It looks OK, does not it ?

PhM

Hi Philippe,

We have further looked into this issue and I would like to share that the PDF file under consideration contains both AcroForm and XFA form fields. However, FieldsNames property returns only AcroForm field names, that’s why you’re having problem. I’m afraid, there is no way to return XFA field names using FieldsNames property. So, you can use the field names in one of the following two ways:


1) form.FillField(“formulaire1[0].Champ_de_texte1”, “sample text”);


or


2) form.FillField(“Champ_de_texte1”, “sample text”);

I hope this helps. If you have any further questions, please do let us know.
Regards,