By multiple docx file conversion into multiple PDF file streams merge into a PDF file stream failed again,only doc and docx failed, other file types is possible.
Hi Ting,
I use this two docx files to PDF format using Aspose.Words and then using Aspose.Pdf to concatenate PDF documents.Then generate pdf files.
The attachments are the three files.
Hi Ting,
this is the merge method:
void Merge(List inputStreamList)
{
var docsArray = new Document[inputStreamList.Count];
var index = 0;
foreach (var pdfStream in inputStreamList)
{
var doc = new Document(pdfStream);
var pdfoutline = new OutlineItemCollection(doc.Outlines);
pdfoutline.Action = new GoToAction(doc.Pages[1]);
doc.Outlines.Add(pdfoutline);
docsArray[index++] = doc;
}
var mergerStream = new MemoryStream();
using (var outDocment = new Document())
{
var editor = new PdfFileEditor();
//editor.Concatenate(inputStreamList.ToArray(), mergerStream);
editor.Concatenate(docsArray, outDocment);
outDocment.Save(mergerStream);
}
using (var fileStream = File.Create(@“D:\TestAspose” + DateTime.UtcNow.Ticks + “.pdf”))
{
mergerStream.Seek(0, SeekOrigin.Begin);
mergerStream.CopyTo(fileStream);
}
}
please quikly reply,thank.
Hi Ting,