JODConverter: Convert xlsx to PDF in LANDSCAPE, all sheets

Talk about anything at all....
Post Reply
zmotiwala
Posts: 46
Joined: Wed Dec 28, 2011 5:34 pm

JODConverter: Convert xlsx to PDF in LANDSCAPE, all sheets

Post by zmotiwala »

Using the following code snippet

Code: Select all

        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!
Last edited by MrProgrammer on Wed Feb 24, 2021 6:45 pm, edited 1 time in total.
Reason: Moved to General Discussion forum from External Programs since this is a JODConverter question
Libre Office 5.2.5
Windows
Post Reply