Concatenate PDF files

Hi. I'm trying to concatenate four PDF files, using the next code in C#, but when I see the file Output.pdf is created with size of 0 bytes. I'm testing Aspose.Pdf.Kit version 1.9.0.0. The size of the source pdf files is between 399 and 612 k. Thanks in advance for the help

string[] FilesInOrder = string[] {"file1.pdf", "file2.pdf", "file3.pdf"};

string FileOutput = "output.pdf";

Stream[] StreamsInput = new Stream[ FilesInOrder.Length ];

for ( int i = 0; i < FilesInOrder.Length; i++ )

{

StreamsInput[ i ] = new FileStream( FilesInOrder[ i ], FileMode.Open );

}

FileStream streamOutput = new FileStream( FileOutput, FileMode.Create );

PdfFileEditor pdfEditor = new PdfFileEditor();

pdfEditor.Concatenate( StreamsInput, streamOutput );

for ( int i = 0; i < FilesInOrder.Length; i++ )

{

StreamsInput[ i ].Close();

}

streamOutput.Close();

Hi,

Thank you for considering Aspose.

I am unable to reproduce this error with latest version of Aspose.Pdf.Kit(2.5.2.0). Please download the latest version and then try again. There is one problem in your code.

string[] FilesInOrder = string[] {“file1.pdf”, “file2.pdf”, “file3.pdf”};

Here no need of “string[]”. It should be like :

string[] FilesInOrder = {“file1.pdf”, “file2.pdf”, “file3.pdf”};

If you still got problems, then please send your Pdf files and we will investigate this issue.

Thanks.