Import Data from XML into PDF

Hi,
I’m building a PDF form using Adobe LiveCycle Designer. The PDF form contains a submit button, which on submit I’ll be getting the XML from the HTTP Response. The XML contains all the data filled by the user. When I try to import data into PDF using this XML I’m getting Object Reference not set an instance of an object error. I’m using the below code to import XML data.

form.ImportXml(xmlInputStream);

Can I know is it possible to import data using XML which I have got from HTTP Response or is there any format I need to maintain to import data from XML.

I have attached the XML and the sample PDF file.

Thanks,
Ganesh

Hi Ganesh,

Thanks for using our products.

I am pleased to share that Aspose.Pdf for .NET supports the capability to import XML file data into PDF form. However the only thing you need to ensure is that the field names specified in XML file are same as original field names present in PDF document. Meanwhile I have also tried importing the XML data into PDF form while using Aspose.Pdf for .NET 6.3.0 and I am unable to notice any exception. The resultant updated PDF document is being generated but with some missing form fields. For the sake of correction, I have logged this issue as PDFNEWNET-31395 in our issue tracking system. We will further look into the detail of this problem and will keep you updated on the status of correction. Please be patient and spare us little time.

For your reference, I have attached the resultant PDF document that I have generated. Please take a look.

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


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

Hi, the problem still exists while importing XML. The problem is combobox value is not selected. I have attached XML and PDF files for reference.
Here is the code I’m using,

FileStream fs=new FileStream(@"D:\output.xml",FileMode.Open);

Aspose.Pdf.Facades.Form form = new Form(@"D:\JobReq.pdf", @"D:\output.pdf");

form.ImportXml(fs);

form.Save();

fs.Close();

Thanks,

Ganesh

Hi Ganesh,

Thank you for sharing the template files and sample code.

We are able to notice the issue with the combobox values not been selected. I have re-opened your issue for further investigation. As soon as we have any updates, I will update you via this forum thread.

Sorry for the inconvenience.

The issues you have found earlier (filed as PDFNEWNET-31395) have been fixed in Aspose.Pdf for .NET 10.5.0.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.