How can I specify the job name when I print workbooks? I’m using this sample, but cannot find an option to set the name.
Aspose.Cells uses “Java Printing” as the job name.
Regards
Paul
Hi Paul,
Hi,
Thanks for using Aspose.Cells for Java.
We have fixed this issue.
Please download and try this fix: Aspose.Cells for Java v8.3.1.2 and let us know your feedback.
We have added the API: toPrinter(String
PrinterName, String JobName) in the WorkbookRender and
SheetRender.
Hi,
thank you for the update. Unfortunately, this fix does not work for me. The following exception thrown:
Exception in thread “main” com.aspose.cells.CellsException: WorkbookRender only support Tiff
at com.aspose.cells.WorkbookRender.(Unknown Source)
I am trying to print a XLSX file. With version 8.3.0, the document is printed with the default “Java Printing” job name.
Regards
Paul
Hi Paul,
Hi,
this seems to be a misunderstanding. I will try to clarify this:
With version 8.3.1.2 attached to Shakeel Faiz’s post and using the new toPrinter(String PrinterName, String JobName) method, I get the exception posted above: WorkbookRender only support Tiff.
With version 8.3.0 that I used before, the document can be printed but the JobName parameter is of course not available.
You may use my document for testing, but I’m sure that any XLSX will reproduce the exception.
This is the code used:
Workbook workbook = new Workbook(new FileInputStream(“Counter.xlsx”));
ImageOrPrintOptions imgOptions = new ImageOrPrintOptions();
WorkbookRender workbookRender = new WorkbookRender(workbook, imgOptions); // this will fail with 8.3.1.2
workbookRender.toPrinter(“Printer name”);
Regards
Paul
Hi Paul,
Workbook excelDocument = new Workbook(“D:/temp/2.xlsx”);
com.aspose.cells.ImageOrPrintOptions imageOrPrintOptions = new com.aspose.cells.ImageOrPrintOptions();
imageOrPrintOptions.setImageFormat(com.aspose.cells.ImageFormat.getTiff());
com.aspose.cells.WorkbookRender render = new com.aspose.cells.WorkbookRender(excelDocument, imageOrPrintOptions);
try {
render.toPrinter(“HP LaserJet Professional P1102”, “test job”);
} catch (Exception exception) {
System.out.println(exception);
}
Hi,
yes, when I set this option it works as expected. Perfect, thank you!
Do you know when this feature will be included in the main branch?
Regards
Paul
Hi Paul,
The issues you have found earlier (filed as CELLSJAVA-41143) have been fixed in this update.
This message was posted using Notification2Forum from Downloads module by Aspose Notifier.