I have a PDF template with same field names for all fields of similar type(please see attached file PTO-SB-45 v03-09.pdf) and am importing the attached XML file with data(PTO-SB-45.xml generated with same field names used in PDF template). When I use the ImportXml() method of Aspose.Pdf.Kit(version 4.3.0) to generate the pdf document(attachment : PTO-SB-45 v03-09 OUT.pdf), only one of the fields is getting filled and also it is filled in wrong location. Here is the sample code that I am using to generate the PDF.
Form form = new Form(@"C:\Temp\PTO-SB-45 v03-09.pdf", @"C:\Temp\PTO-SB-45 v03-09 OUT.pdf");
//Create an XML file as a FileStream that contains the contents of the PDF document
System.IO.FileStream xmlInputStream = new FileStream(@"C:\Temp\PTO-SB-45.xml", FileMode.Open);
//Import the values from the XML file to the PDF form
form.ImportXml(xmlInputStream);
//Save the output PDF document
form.Save();
//Close the input XML stream
xmlInputStream.Close();
In the XML file, I have many tags with the name same name <TextField1>, and with different values. After importing, the output PDF is having the first field with bookmark name "TextField1" filled with the last node value having the same name "<TextField1>+33 142501910</TextField1> " from XML file. All other fields are empty in the generated PDF file. But my requirement is to fill the form fields with data from XML file in the same order i.e, the first field in PDF template with bookmark name "TextField1" should be filled with the data from first node of XML with name "TextField1". Similarly the second field in PDF template with bookmark name "TextField1" should be filled with the data from second node of XML with name "TextField1".
Please help me in resolving this issue
Regards,
Dinesh