Free Support Forum - aspose.com

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

PdfMergeStreams.zip (316.5 KB)

@skuehn,

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

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