How to set landscape/portrait when printing headless?

I configured my default printer (via CUPS) to do: A4 paper format, draft mode.
I.e. libreoffice -p prints my XLSX files as I wish.
But there is no option for landscape vs. portrait in CUPS, and unfortunately it prints portrait, while I need landscape right now.
As it does work from the UI, I assume, that this is a setting by libreoffice, not CUPS, right?
Can I set landscape as default somehow?
Or is there a command line option to force landscape?

Thank you!

Ask/Guide - How to use the Ask site - The Document Foundation Wiki #Are_there_any_answers_to_my_question_yet

1 Like

I’m not yet sure, if this would help me, as I’m not trying to export to PDF.
I did now export a file to PDF, just for test, but I can’t see any landscape option there.
It seems, I would have to set the landscape option for every single file below Format/Page Style, right?Opening every single file was exactly what I would like to avoid.

You might give the community a further idea about what you are trying to accomplish. Do you have a directory (folder) with hundreds of single-page files you need to print? There might be a python solution to, in fact, loop through all the files in a directory and change their page orientation. That’s not my expertise (if I even have one), but more information about your scenario might lead to something.

→ lp(1) - Linux manual page :wink: