Hi Daniel,
I have tested the issue at my end but couldn't notice the problem. I have tested with Aspose.Pdf.Kit 3.6.0.0. Can you please make sure that you're using the latest version? Also, try using the following code; I have used this snippet at my end:
int[] pages = new int[] { 1 };
int location = 0;
PdfFileEditor pdfEditor = new PdfFileEditor();
FileStream firstpageStream = new FileStream("singlepage.pdf",FileMode.Open, FileAccess.Read);
FileStream contentStream = new FileStream("input.pdf",FileMode.Open, FileAccess.Read);
MemoryStream tempStream = new MemoryStream();
MemoryStream outStream = new MemoryStream();
//create merged PDF document
pdfEditor.SplitToEnd(contentStream, 2, tempStream);
pdfEditor.Insert(tempStream, location, firstpageStream, pages, outStream);
FileStream output = new FileStream("output.pdf", FileMode.Create, FileAccess.Write);
outStream.Seek(0, SeekOrigin.Begin);
byte[] data = new byte[outStream.Length];
outStream.Read(data, 0, data.Length);
output.Write(data, 0, data.Length);
firstpageStream.Close();
contentStream.Close();
tempStream.Close();
output.Close();
If problem persists then please share a sample project which can reproduce the problem. Also, any other details would be helpful i.e. OS/Culture etc.
We're sorry for the inconvenience.
Regards,
Shahzad Latif - [
Follow me on Twitter!]
Support Developer/Developer Evangelist
Aspose Sialkot Team
Aspose - Your File Format Experts
Keep in touch! We're on
Twitter and
Facebook