I use this command to convert many .docx, .pptx, and .xlsx files to pdf with a powershell script:
& “C:\Program Files\LibreOffice\program\soffice” --headless --convert-to pdf $inputFile --outdir $outputSubFolder
This works great but if there is a .xlsx file with too many columns it prints on many pages and becomes hard to read and understand. When exporting manually from LibreOffice Calc, I can change the format to be landscape and to fit to page width, which produces the desired outcome. I tried making these settings the default template but still every time I try to export a new file the old default comes back and it prints to many pages in portrait again. How can I make all .xlsx files export with the settings I want?