// Create a pdf file stream using FileStream outputStream = new FileStream("SaveMultipleWorkbooksToPDF.pdf", FileMode.Create); //create a new workbook var workbook = new GrapeCity.Documents.Excel.Workbook(); Stream fileStream = this.GetResourceStream("xlsx\\Any year calendar1.xlsx"); workbook.Open(fileStream); GrapeCity.Documents.Excel.Workbook workbook2 = new GrapeCity.Documents.Excel.Workbook(); Stream fileStream2 = this.GetResourceStream("xlsx\\Any year calendar (Ion theme)1.xlsx"); workbook2.Open(fileStream2); //Create a printmanager. GrapeCity.Documents.Excel.PrintManager printManager = new GrapeCity.Documents.Excel.PrintManager(); //Save the workbook1 and workbook2 into one pdf file. printManager.SavePDF(outputStream, workbook, workbook2); // close the pdf stream outputStream.Close();
' Create a pdf file stream Dim outputStream = File.Create("SaveMultipleWorkbooksToPDF.pdf") ' Create a new Workbook Dim workbook As New Workbook Dim fileStream As Stream = GetResourceStream("Any year calendar1.xlsx") workbook.Open(fileStream) Dim workbook2 As New Excel.Workbook Dim fileStream2 As Stream = GetResourceStream("Any year calendar (Ion theme)1.xlsx") workbook2.Open(fileStream2) 'Create a printmanager. Dim printManager As New Excel.PrintManager 'Save the workbook1 and workbook2 into one pdf file. printManager.SavePDF(outputStream, workbook, workbook2) ' close the pdf stream outputStream.Close()