Stampa copie multiple di un foglio di lavoro

Stampa copie multiple di un foglio di lavoro

Aspose.Cells fornisce la possibilità di stampare copie multiple di un foglio di lavoro utilizzando il metodo SheetRender.ToPrinter(PrintSettings PrinterSettings). Il seguente frammento di codice dimostra l’utilizzo del metodo SheetRender.ToPrinter(PrintSettings PrinterSettings) per stampare copie multiple di un foglio di lavoro. Il seguente frammento di codice utilizza questo file excel di esempio.

Codice di esempio

// 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);