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

Free Support Forum - aspose.com

Detect XFA forms prior to merge with PDFFileEditor.Concatenate

So, we have input consisting of what to the code is random, unknown PDF files...which we then merge for delivery.

This has been working well, but we recently have someone put two PDF's that happen to have XFA forms into the same group to be merged and receive the "Concatenating XFA Forms is not allowed" error.

I understand that I need to call FlattenAllFields when this scenario comes up -- but need to know the "best" way to quickly check if the input files have XFA forms or not!

Any suggestions?

Hi Stan,

Do you want to check whether the PDF file is XFA form or not? Or you just want to make sure that the files are successfully concatenated whether they’re XFA forms or not? If it is the second case then the issue is already logged as PDFKITNET-21262 in our issue tracking system. However, if you have some different requirement then please do let us know.


If I understand correctly, PDFKITNET-21262, once released will make this a non-issue ... but as developers we all know that could be a while. Unless of course you have reached the point of immenant availability???

So, in order to work around the issue I am wondering if somewhere in Aspose.Total there is a way that I can check to see if a given PDF includes an XFA form -- so, yes, a way to check wheter the PDF has an XFA form or not would be helpful.

Hi Stan,

I’m sorry to share with you that checking whether a PDF form is XFA form is not feasible at the moment either. However, I have logged a separate request as PDFKITNET-26750 to just find out whether the form is XFA form or not. You’ll be updated via this forum thread once this feature is supported.

We’re sorry for the inconvenience.

Is there now a possibility to check whether a given PDF is a XFA form or a simple standard PDF?

Hi Petra,

Thanks for your inquriy. Yes, you can check PDF form type as following using Aspose.Pdf for Java.

Document document = new Document(“input.pdf”);<o:p></o:p>

//Possible Form type values are: Standard=0, Static=1, Dynamic=2.


Please feel free to contact us for any further assistance.

Best Regards,