I have a PDF form in which I am trying to populate fields using .NET. The fields are XFA form fields. I don't know the names of the fields and I have tried using the FieldNames property to determine the names but the property has nothing in it. Can anyone suggest how I can fill out these form fields? I have attached the PDF form I wish to use.
I have reproduced this problem at my end and logged it as PDFKITNET-14073 in our issue tracking system. Our team will look into this issue and you’ll be updated via this forum thread once the issue is resolved.
I have downloaded the evaluation version of Aspose.pdf.kit, its version net3.5
I am trying to fill an XFA form and flatten it. Form is not getting filled with data, I am using the following code:-
Can you please provide assistance? Thanks
Aspose.Pdf.Kit.Form form = new Aspose.Pdf.Kit.Form("C:\\Documents and Settings\\xx05621\\My Documents\\HVaid\\Docs\\JPMCQ12011\\PDF Stuff\\2CopySummary.pdf", "C:\\Documents and Settings\\xx05621\\My Documents\\HVaid\\Docs\\JPMCQ12011\\PDF Stuff\\studentOut.pdf");
//Create an XML file as a FileStream that contains the contents of the PDF document
System.IO.FileStream xmlInputStream = new FileStream("C:\\Documents and Settings\\xx05621\\My Documents\\HVaid\\Docs\\JPMCQ12011\\PDF Stuff\\PDFGen\\PDFGen\\2Summary.xml", FileMode.Open);
form.ImportXml(xmlInputStream);
//xmlDoc.Load("C:\\Documents and Settings\\xx05621\\My Documents\\HVaid\\Docs\\JPMCQ12011\\PDF Stuff\\PDFGen\\PDFGen\\Summary.xml");
Please share the input PDF and XML files with us, so we could investigate the issue at our end. You may attach the files with this post. You’ll be updated with the results accordingly.
I downloaded the PDF.KIT for .NET 4.9 version. I have a dynamic pdf that is generated out of livecycle and XFA fields are filled.
I am trying to flatten it up and using the following code:-
Aspose.Pdf.Kit.Form form2 = new Aspose.Pdf.Kit.Form("C:\\New.PDF","C:\\OUT.PDF");
form2.FlattenAllFields();
form2.Save();
It is not erroring out at FlattenAllFields method, but the endresult i.e. Out.pdf is showing me the template file and data is vanishing.
I am attaching the 2 files; New.pdf is the one that requires flattening. Out.pdf does not have the data after flattening. Is there a way I can see data also in the flattened version. Please let me know. Thank You
As I can see, new.pdf already looks like flattened; I can’t see any editable fields in it which need to be flattened. In order to understand and then resolve the issue, we need to create your particular scenario at our end. So, please share the input PDF file before filling, along with the input XML file. We’ll try to fill the fields and then flatten it; this will help us understand where the issue actually exists.
We’re sorry for the inconvenience and looking forward to help you out. Regards,
Thanks for the input. AP_POSummary_Template.pdf is the pdf document created through Adobe LiveCycle that needs to be filled in. Summary.xml is the XML file.
I have tried to fill the PDF at my end using latest version (5.2.0) and the output PDF file is attached with this post. Could you please have a look at the output file and share if you find any anomalies or missing values? I just wanted to make sure that we’re on the same page before proceeding towards the resolution of this issue. Moreover, please share whether you’re having problem only with filling the PDF file from XML or there is some other concern. I would like to add that this file is not editable already, so there is no need to flatten this file.
Please share your thoughts, so we could help you out accordingly. Regards,
Thanks for trying it out. Filled file seems filled fine with most of the data other than one collection elements for TargetAllocations. I am not having any problem with filling the pdf on my side. Main issue I am having is after the pdf template is filled I need to merge the filled document with another static PDF. Whenever I try to merge it the content\data of the template that was filled with data are Lost and only see the template. Do you know of any utility at your end that could merge this dynamic Filled PDF with another PDF. I believe its because the filled file is XML based, so either it needs flattening or something. If there is a way I can convert this Filled.pdf to a static pdf, I will be ok. If I open this file in LiveCycle designer I see the template without the data - I would rather want to see the static file with data. Any input, please let me know. Thanks alot for your time.
Are you trying to concatenate the filled PDF with other files using Aspose.Pdf.Kit or some other tool? If you’re using Aspose.Pdf.Kit then I would like to share with you that it currently doesn’t allow you to concatenate XFA forms; the input PDF file is XFA form. Our team is working on the full support of XFA forms; however, if you could share a sample PDF file you’re trying to concatenate this filled PDF with, using Aspose.Pdf.Kit, I’ll log the issue so that we’ll be able to cater your particular scenario as well.