Free Support Forum -

PdfFileEditor merge fails on merging streams

Dear Sir/Madam,

please refer to attached example, which produces a corrupt pdf file using PdfFileEditor
on memory streams.

I would expect the method to either produce a valid pdf file or to raise an error.

Kind Regards
Stephan (316.5 KB)


The page range is incorrect. Each PDF document has a single page, and we can define the start and end page indexes as follows:

fileEditor.Append(firstStream, new Stream[] { stream1, stream2 }, 1, 1, outstream);