Free Support Forum -

PDFFileEditor.Concatenate() failure


I am currently using the evaluation versions of PDF, PDFKit, and Word from your company. These are nice tools, and apparently the only ones that can do what we will need to do, but I’ve been having a very hard time figuring them out without much good documentation. I’ve spent hours on this site reading through examples and other people’s troubles, but I cannot find a solution for this (C#) problem:

I have a complicated function that populates a stream array with MemoryStreams that each represent a PDF file. These streams can be written to the file system and then opened manually with no problem, but when I call:

PdfFileEditor fileEditor = new PdfFileEditor();
fileEditor.Concatenate(streams, finalPdfStream);

and then write the finalPdfStream to the file system, it cannot be opened. The OS says that it must be corrupt and won’t open it.

I know for sure that the individual memory streams are good… I write them to the file system and they open. When I write the finalPdfStream, I get a good-sized pdf file… 300-400k… but I can’t open it.

I am converting word documents to the pdf docs, but that part is working…

Do you know what could be causing this problem?

Can you please help me find a way to concatenate these files?

I need to finish this portion of code today so your quick response is greatly appreciated.


Dear zack,

Thank you for considering Aspose.

Can you please provide you code that can reproduce the error? We will fix this problem soon if it is a bug. BTW, which part of the document that you are not satisfied? If you can tell us we will try to improve it.


Which version of Aspose.Pdf.Kit do you use? Could you have a try with the latest version for avoiding unexpected errors?

Thanks for your response…

I decided to use a different class in the end to accomplish what I was trying to do. I think the problem was with the ‘position’ property of the memory stream. Apparently it must be re-set to 0 in order for the concat function to work (?)…

As for documentation, I think it would be appropriate for the actual source of your code to be documented so that when I go to use a function, the MS Intellisense will tell me what parameters are expected and what the options are.

For example, in ASPose Words, when I create a Document object, in addition to telling me what parameters I can pass, I would like to know what they mean (what kind of stream? what kind of string?). Your documentation under API on this website also lacks this information and it makes it difficult to know what I can use for which purposes, especially given the way that PDF, PDFKit, and Words all do similar things.

Thanks for your consideration,

Hi Zack,

Really appreciated for your sugguestion which is really helpful to make our components more professinal.

Our developers will try to promote these features in next version.

Best regards,