Hi,
I am looking for a way to concatenate 2 or more word or cell objects i just created/loaded into memory, without having to save it to a pdf file first. I can load an excel and word file into a memory stream and convert them to pdf (if necessary) as shown below. The problem occurs when I try to concatenate the memory streams. I can save them to disk then load the newly created pdfs as FileStreams and concatenate them into a single pdf with the PDFFileEditor but I would prefer to do this without having to save unnecessary files. Any suggestions?
Dim wordPDFFile As New System.IO.MemoryStream()
Dim cellPDFFile As New System.IO.MemoryStream()
Dim msWord As New System.IO.MemoryStream()
Dim msCell As New System.IO.MemoryStream()
Dim pdfExcel As New Aspose.Pdf.Pdf()
Dim pdfWord As New Aspose.Pdf.Pdf()
'Load Word Document
Dim wd As New Aspose.Words.Document("WordFile1.doc")
wd.Save(msWord, Aspose.Words.SaveFormat.AsposePdf)
pdfWord.BindXML(msWord, Nothing)
pdfWord.Save(wordPDFFile)
'Load Excel Document
Dim xls As New Aspose.Cells.Workbook()
xls.Open("Excel.xls")
xls.Save(msCell, Aspose.Cells.FileFormatType.AsposePdf)
pdfExcel.BindXML(msCell, Nothing)
pdfExcel.Save(pdfName2)
Dim outputStream As FileStream = New FileStream("out.pdf",FileMode.Create)
Dim editor As Aspose.Pdf.Kit.PdfFileEditor = New Aspose.Pdf.Kit.PdfFileEditor
editor.Concatenate(wordPDFFile , cellPDFFile, outputStream)