- Code: Select all Expand viewCollapse view
Map<String,Object> printSettings = new HashMap<String,Object>();
printSettings.put("PaperOrientation", PaperOrientation.LANDSCAPE);
printSettings.put("PaperFormat", PaperFormat.TABLOID);
PropertyValue[] printerDesc = OfficeUtils.toUnoProperties(printSettings);
XPrintable xPrintable = OfficeUtils.cast(XPrintable.class, document);
xPrintable.setPrinter(printerDesc);
My first sheet in the xlsx file converts to landscape mode and tabloid paper format. But the rest of the sheets print in portrait mode. Is there any way to apply this for all sheets?
I am using JODConverter and LibreOffice.
Thanks!