[]
Paginates each workbook and saves all generated pages to the specified PDF file stream.
public void SavePDF(Stream stream, IEnumerable<Workbook> workbooks, PdfSaveOptions options = null)
Public Sub SavePDF(stream As Stream, workbooks As IEnumerable(Of Workbook), Optional options As PdfSaveOptions = Nothing)
| Type | Name | Description |
|---|---|---|
| Stream | stream | The specified pdf file. |
| IEnumerable<Workbook> | workbooks | The workbooks to save. The workbooks are processed in the order they appear in the list. |
| PdfSaveOptions | options | Options for saving pdf file. |
worksheet.PageSetup.PrintArea = "B2:D6";
worksheet.Range["B2:D6"].Value = "Test";
Workbook secondWorkbook = new Workbook();
secondWorkbook.Worksheets[0].Range["B2"].Value = "Summary";
List<Workbook> workbooks = new List<Workbook> { workbook, secondWorkbook };
PrintManager printManager = new PrintManager();
using (MemoryStream stream = new MemoryStream())
{
printManager.SavePDF(stream, workbooks, new PdfSaveOptions());
}
Paginates each workbook and saves all generated pages to the specified PDF file stream.
public void SavePDF(Stream stream, params Workbook[] workbooks)
Public Sub SavePDF(stream As Stream, ParamArray workbooks As Workbook())
| Type | Name | Description |
|---|---|---|
| Stream | stream | The specified pdf file. |
| Workbook[] | workbooks | The workbook collection. |
worksheet.PageSetup.PrintArea = "B2:D6";
worksheet.Range["B2:D6"].Value = "Test";
Workbook secondWorkbook = new Workbook();
secondWorkbook.Worksheets[0].Range["A1"].Value = "Second workbook";
PrintManager printManager = new PrintManager();
using (MemoryStream stream = new MemoryStream())
{
printManager.SavePDF(stream, workbook, secondWorkbook);
}
Paginates each workbook and saves all generated pages to the specified PDF file.
public void SavePDF(string fileName, IEnumerable<Workbook> workbooks, PdfSaveOptions options = null)
Public Sub SavePDF(fileName As String, workbooks As IEnumerable(Of Workbook), Optional options As PdfSaveOptions = Nothing)
| Type | Name | Description |
|---|---|---|
| string | fileName | The specified pdf file. |
| IEnumerable<Workbook> | workbooks | The workbook collection. |
| PdfSaveOptions | options | Options for saving pdf file. |
worksheet.Range["A1"].Value = "First workbook";
Workbook secondWorkbook = new Workbook();
secondWorkbook.Worksheets[0].Range["A1"].Value = "Second workbook";
List<Workbook> workbooks = new List<Workbook> { workbook, secondWorkbook };
PrintManager printManager = new PrintManager();
PdfSaveOptions options = new PdfSaveOptions();
string fileName = Path.Combine(Path.GetTempPath(), "Workbooks.pdf");
printManager.SavePDF(fileName, workbooks, options);
Paginates each workbook and saves all generated pages to the specified PDF file.
public void SavePDF(string fileName, params Workbook[] workbooks)
Public Sub SavePDF(fileName As String, ParamArray workbooks As Workbook())
| Type | Name | Description |
|---|---|---|
| string | fileName | The specified pdf file. |
| Workbook[] | workbooks | The workbook collection. |
worksheet.Range["A1"].Value = "First workbook";
Workbook secondWorkbook = new Workbook();
secondWorkbook.Worksheets[0].Range["A1"].Value = "Second workbook";
PrintManager printManager = new PrintManager();
string fileName = Path.Combine(Path.GetTempPath(), "Workbooks.pdf");
printManager.SavePDF(fileName, workbook, secondWorkbook);
Saves the page datas to the specified pdf file.
public void SavePDF(string fileName, IList<PageInfo> pages, PdfSaveOptions options = null)
Public Sub SavePDF(fileName As String, pages As IList(Of PageInfo), Optional options As PdfSaveOptions = Nothing)
| Type | Name | Description |
|---|---|---|
| string | fileName | The specified pdf file. |
| IList<PageInfo> | pages | The page information collection. |
| PdfSaveOptions | options | Options for saving pdf file. |
worksheet.PageSetup.PrintArea = "A1:B4";
worksheet.Range["A1:B4"].Value = new object[,]
{
{ "Name", "Value" },
{ "A", 100 },
{ "B", 200 },
{ "C", 300 }
};
PrintManager printManager = new PrintManager();
IList<PageInfo> pages = printManager.Paginate(worksheet);
string fileName = Path.Combine(Path.GetTempPath(), "WorksheetPages.pdf");
printManager.SavePDF(fileName, pages, new PdfSaveOptions());
Saves the page datas to the specified pdf file stream.
public void SavePDF(Stream stream, IList<PageInfo> pages, PdfSaveOptions options = null)
Public Sub SavePDF(stream As Stream, pages As IList(Of PageInfo), Optional options As PdfSaveOptions = Nothing)
| Type | Name | Description |
|---|---|---|
| Stream | stream | The specified pdf file. |
| IList<PageInfo> | pages | The page information collection. |
| PdfSaveOptions | options | Options for saving pdf file. |
worksheet.PageSetup.PrintArea = "A1:B4";
worksheet.Range["A1:B4"].Value = new object[,]
{
{ "Name", "Value" },
{ "A", 100 },
{ "B", 200 },
{ "C", 300 }
};
PrintManager printManager = new PrintManager();
IList<PageInfo> pages = printManager.Paginate(worksheet);
using MemoryStream stream = new MemoryStream();
printManager.SavePDF(stream, pages, new PdfSaveOptions());