打印工作表的多份副本
Contents
[
Hide
]
打印工作表的多份副本
Aspose.Cells 提供了通过使用SheetRender.ToPrinter(PrintSettings PrinterSettings)方法。下面的代码片段演示了使用SheetRender.ToPrinter(PrintSettings PrinterSettings)打印工作表的多个副本的方法。下面的代码片段使用了这个示例 excel 文件.
示例代码
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-.NET | |
//Source directory | |
string sourceDir = RunExamples.Get_SourceDirectory(); | |
//Load source Excel file | |
Workbook workbook = new Workbook(sourceDir + "SheetRenderSample.xlsx"); | |
ImageOrPrintOptions imgOpt = new ImageOrPrintOptions(); | |
//Access first worksheet | |
Worksheet worksheet = workbook.Worksheets[1]; | |
SheetRender sheetRender = new SheetRender(worksheet, imgOpt); | |
PrinterSettings printerSettings = new PrinterSettings(); | |
printerSettings.PrinterName = "<PRINTER NAME>"; | |
printerSettings.Copies = 2; | |
sheetRender.ToPrinter(printerSettings); |