Error: Concatenating XFA forms is not allowed

Hi,

When I concatenate two forms got the below error and here is the code I used:

Concatenating XFA forms is not allowed.

using (
//Create input stream objects holding the PDF files to be concatenated
FileStream inStream1 = new FileStream(@“D:\one.pdf”, FileMode.Open),
inStream2 = new FileStream(@“D:\two.pdf”, FileMode.Open),inStream3 = new FileStream(@“D:\three.pdf”, FileMode.Open)
)
{
//Create output stream object that would contain the final PDF file
FileStream outStream = new FileStream(@“D:\four.pdf”, FileMode.Create);
//Store all input streams in an Array
Stream[] inStreams = new Stream[] { inStream1, inStream2,inStream3 };
//Instantiate PdfFileEditor object
PdfFileEditor pdfEditor = new PdfFileEditor();
//Call Concatenate method of PdfFileEditor object to concatenate all input streams into a single output stream
//pdfEditor.Concatenate(inStreams, outStream); // Error
pdfEditor.ConcatenateForms(inStreams, outStream); // works fine
//Finally close the output stream
outStream.Close();
}

I got error on Concatenate() method, but when I use ConcatenateForms() method it works fine. But when I check aspose.pdf.kit document ConcatenateForms() method is an obsolute method. So Is it safe to use this method? How can I Make working Concatenate() method?

Hi Srinu,

First off, please download our latest merged version of Aspose.Pdf for .NET and try at your end. Aspose.Pdf.Kit for .NET have been merged into this component and you can execute your existing code using Aspose.Pdf.Facades namespace. If you still find the same issue then please share the input PDF files with us, so we could investigate the issue at our end. You’ll be updated with the results accordingly.

We’re sorry for the inconvenience.
Regards,