JODConverter: Convert xlsx to PDF in LANDSCAPE, all sheets

Talk about anything at all....

JODConverter: Convert xlsx to PDF in LANDSCAPE, all sheets

Postby zmotiwala » Thu Jan 14, 2021 8:57 pm

Using the following code snippet

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

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.

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
Posts: 42
Joined: Wed Dec 28, 2011 5:34 pm

Return to General Discussion

Who is online

Users browsing this forum: No registered users and 4 guests