在 xlsx4j 中打印工作簿
Contents
[
Hide
]
Aspose.Cells - 打印工作簿
完成电子表格创建后,您可能需要根据需要打印一份工作表的硬拷贝。打印时,MS Excel 假定您要打印整个工作表区域,除非您指定了您的选择。
打印工作表
Java
//Instantiate a new workbook
Workbook book = new Workbook(dataDir + "AsposeDataInput.xls");
//Create an object for ImageOptions
ImageOrPrintOptions imgOptions = new ImageOrPrintOptions ();
//Get the first worksheet
Worksheet sheet = book.getWorksheets().get(0);
//Create a SheetRender object with respect to your desired sheet
SheetRender sr = new SheetRender(sheet, imgOptions);
//Print the worksheet
sr.toPrinter("Samsung ML-1520 Series");
打印工作簿
Java
//Create a WorkbookRender object with respect to your workbook
WorkbookRender wr = new WorkbookRender(book, imgOptions);
//Print the workbook
wr.toPrinter("Samsung ML-1520 Series");
下载运行代码
下载示例代码
欲了解更多详情,请访问打印工作簿.