Few Fields not being populated onto XFA PDF using XML

Hello I am using the below code to populate the attached PDF (FDA-3331a_Dyn_Sec_Ext_10-14-2024-unlocked.pdf) using attached
FDA-3331a_Dyn_Sec_Ext_10-14-2024-unlocked.pdf (3.3 MB)

XML (Pasted below) but few fields do not populate.

Can you please look into this?

static void Main(string[] args)
{
var doc = new Document(“FDA-3331a_Dyn_Sec_Ext_10-14-2024-unlocked.pdf”);
var m_form = new Aspose.Pdf.Facades.Form();
m_form.BindPdf(doc);
XmlDocument xmldoc = new XmlDocument();
xmldoc.Load(“New Data.xml”);
XmlElement root = xmldoc.DocumentElement;
MemoryStream xmlStream = new MemoryStream();
xmldoc.Save(xmlStream);
m_form.ImportXml(xmlStream, false);
m_form.Save(“Output.pdf”);
}

XML:

<?xml version="1.0" encoding="UTF-8"?>
<Subform>
<AddressList>PHI-DO</AddressList>
<DistNameAdd>testdata</DistNameAdd>
<MfrControlNo>Ctrl 123</MfrControlNo
><reportversion_Initial
>1</reportversion_Initial
><reportversion_FU
>0</reportversion_FU
><reportversion_Final
>0</reportversion_Final
><problemfirm>Firm 1</problemfirm
><problemfirmaddress>1235 ABC Street</problemfirmaddress
><problemfirmcity>Tampa</problemfirmcity
><problemfirmstate>Florida</problemfirmstate
><problemfirmcountry>United States</problemfirmcountry
><problemfirmpostalcode>33617</problemfirmpostalcode
><problemfirmDUNS>12345</problemfirmDUNS
><problemfirmDUNSna
>0</problemfirmDUNSna
><problemfirmFEI>33221</problemfirmFEI
><problemfirmFEIna
>0</problemfirmFEIna
><ndaandaother
>NDA</ndaandaother
><appnumber
>223354</appnumber
><ndc>NDC Number</ndc
><activedrugsubstance
>Generic Prod Name</activedrugsubstance
><medicinalproduct>Trade Name</medicinalproduct
><dosageform>Dosage</dosageform
><dosagestrength>5 mg and 6 ml</dosagestrength
><drugbatchnumb_expiry>tsagdiuhau, dyhasiuhdosa, duiashdoasiod, y8uuashdoijhasiodjoas</drugbatchnumb_expiry
><problemstartdate
>2025-02-27</problemstartdate
><problemhistorytext>Aise hi</problemhistorytext
><drugproblem
>No problem just enjoy life</drugproblem
><codeddefect
>Meddra Terminology is not avilable</codeddefect
><reporteddefect
>Reported Quality</reporteddefect
><probcause>Root Cause of the Problem</probcause
><coract>Describe Corrective Action</coract
><remarks>Remarks are REAL</remarks
><reportername
>Establishment Name</reportername
><reporteraddress
>4567 W Keneddy Blvd</reporteraddress
><reportercity
>Austin</reportercity
><reporterstate
>Texas</reporterstate
><reportercountry
>United States</reportercountry
><reporterpostalcode
>33452</reporterpostalcode
><reporterDUNS
>DUNS 123</reporterDUNS
><reporterDUNSna
>0</reporterDUNSna
><reporterFEI
>FEI 123</reporterFEI
><reporterFEIna
>0</reporterFEIna
><reporterfamilyname>test name</reporterfamilyname
><reportertel
>1234567890</reportertel
><reporteremail
>email@gmail.com</reporteremail
><DateSubmission
>2025-02-27</DateSubmission
><TimePrint
>15:53:28 GMT -5</TimePrint
></Subform
>

@harrynator

It seems you are experiencing issues with certain fields not being populated in your XFA PDF when using XML data. Here are a few steps and considerations that might help you troubleshoot the problem:

  1. Field Names: Ensure that the field names in your XML match exactly with the field names defined in the XFA form. Any discrepancies, including case sensitivity or extra spaces, can lead to fields not being populated.

  2. XML Structure: Verify that the XML structure is correct and adheres to the expected format for the XFA form. Each field should be properly nested within the <Subform> element, and the XML should be well-formed (e.g., all tags should be properly closed).

  3. Dynamic Fields: Some fields in XFA forms may be dynamic, meaning they can change based on user input or other conditions. If certain fields are not appearing, check if they are set to be visible or enabled based on the data being provided.

  4. Field Properties: If you have access to the XFA form’s properties, you can check if the fields are set to read-only or if there are any conditions that prevent them from being populated.

  5. Testing with Minimal XML: Try populating the form with a minimal XML that only includes the fields you are having trouble with. This can help isolate the issue and determine if the problem lies with specific fields or the overall XML structure.

  6. Conversion to AcroForm: If you continue to face issues, consider converting the XFA form to a standard AcroForm. This can sometimes simplify the process of populating fields, as AcroForms are generally easier to work with.

If you have checked all of the above and are still facing issues, please provide more details about which specific fields are not populating, and any error messages you might be receiving. This information can help in diagnosing the problem further.

If you need more detailed guidance on working with XFA forms, you might want to refer to the documentation on handling XFA forms with Aspose.PDF, which provides insights into filling fields and managing form properties.

Feel free to reach out with any further questions or clarifications!

Sources:
[1]: Working with XFA Forms using C++|Aspose.PDF for C++ - Aspose Documentation

@asad.ali Would you be able to look at this issue and let us know as it is blocking us.
The reply above seems just like a standard AI reply and we have already tried the options mentioned in it and it did not work.

Thanks.

@harrynator

Would you kindly share generated output as well for our reference that you obtained in your environment? Also, please share if you are facing this issue with all PDF file or just the one that you shared?