Merge With Blank Document

Hi all

I have a requirement to merge two pdf documents with a blank page in between. As per API I should be able to achieve this using the following:

pdfEditor.Concatenate(fs1, fs2, fsBlank, outStream)

where pdfEditor is a instance of PdfFileEditor

fs1 and fs2 are the file streams to merge and fsBlank is the blank page separator. However when executed, I get 0 byte file created.

If on the other hand I use 2 instead of 3 streams (i.e. fs1 and fsBlank or fs1 and fs2) then I get the desired result.

To be clear my requirement is (assuming p => page)

Pdf1 = p1,p2,p3,p4,p5

Pdf2 = p1,p2,p5

Desired result = new PDF = {Pdf1 + pdf blank + pdf2} = p1,p2,p3,p4,p5,pblank,p7,p8,p9

Any help greatly appreciated.

Hi Francis,


Thanks for contacting support.

The behavior stated above is bit strange because o byte file is being generated when using three streams. However instead of using Aspose.Pdf.Facades, I recommend you to please try using new Document Object Model (DOM) of Aspose.Pdf namespace. Please take a look over following topics


In case you still face any issue, please share the resource files and code snippet. We are sorry for your inconvenience.