We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Flattening Dynamic XFA PDF

Hi, We are currently evaluating this product to see if this fits our need before we make any purchase.

We have a dynamic XFA form that is already filled. We need to flatten this out for the purpose of page collation. I tried using the trial version and wrote some code to try this out, but was unable to successfully flatten out the file. I did read somewhere in your forums and questions that this was resolved in one of the release but not sure if the latest download for trial contains this feature.

Also I was unable to find specific examples to be able to do this.
Here is what I was writing-


Aspose.Pdf.Document doc = new Aspose.Pdf.Document(_sourcefilePath);
Aspose.Pdf.InteractiveFeatures.Forms.XFA xfa = doc.Form.XFA;
doc.Optimize();
doc.Flatten();

doc.Save(_outputfilePath);

Let me know if this is sufficient to flatten out a filled in pdf file and this library supports such capability.

Thanks,
Nikhil.

Hi Nikhil,


Thanks for your inquiry. You need to convert XFA form to standard form before flattening it. Please check following documentation link for the purpose. If the issue persist then please share your sample PDF document here, we will look into it and guide you accordingly.


We are sorry for the inconvenience caused.

Best Regards,