Headless page scaling

asked 2015-12-14 23:35:22 +0200

kylew gravatar image

updated 2016-03-12 14:15:39 +0200

Alex Kemp gravatar image

I set up a Ubuntu 14.04 server with LibreOffice 4.2.8.2 installed on it, and I'm trying to batch convert XLS files to PDF. Right now my command looks like this:

libreoffice --headless --convert-to pdf:writer_pdf_Export --outdir /mnt/share/converted *.xls

There's no problem actually converting, but the XLS documents are getting broken into a 2nd page. They have a print area already set and it renders fine on Windows version of Excel. If I manually open LibreOffice and export as PDF, I'm able to set the Page Scaling option to force everything into 1 page. Running the command after the fact does not keep these settings though, and I can't find any documentation on how to pass this parameter in through the terminal.

I'm also attempting to use unoconv to do the same, but passing -e ScaleToPagesX=1 and -e ScaleToPagesY=1 seems to do nothing. It seems like it's a LibreOffice problem.

If anyone has a way to force the page scaling, I would greatly appreciate it. Thanks!

edit retag flag offensive close merge delete