Hi, I am new to ASPOSE.Pdf. I have an XFA form that has multiple fields. There is also a table in a Subform in the Main. I have an XML data file that will populate the XFA form. Issue is that only fields that are directly under Main get populated, but any fields that are in a Subform within the Main are not being populated.
For example below get populated :
topmostSubform[0].Main[0].CLAIMNO[0]
But below does not get populated as it has a subForm in Main called “TopSubForm”:
topmostSubform[0].Main[0].TopSubForm[0].CLAIMNO[0]
Same is true for the table that is within a Subform (“ProviderSubForm”) in the Main. It does not get populated:
topmostSubform[0].Main[0].ProviderSubForm[0].Provider[0].Row1[0].PROVIDERNAME[0]
My code is something like this. Please let me know if there is a better way to do this.
string _formPath = @“XFATemplateFile.pdf”;
// Open document
Aspose.Pdf.Facades.Form form = new Aspose.Pdf.Facades.Form();
form.BindPdf(_formPath);
// Open xml file.
System.IO.FileStream xmlInputStream = new FileStream(@"TestDataFile.xml", FileMode.Open);
// Import data
form.ImportXml(xmlInputStream);
// Close file stream
xmlInputStream.Close();
string _outFileLoc = @"OutputFile.pdf";
// Save updated document
form.Save(_outFileLoc);