Command line Conversion Options

asked 2017-10-05 14:53:47 +0200

sdeshpande gravatar image

Hi Guys,

Can you please tell me if the LibreOffice command line conversion has ability to fit the excel file to one page only ? I am currently using libreoffice to convert the excel files that we receive from outside vendor to pdf before loading it to our database. Unfortunately sometimes that the length of columns in the file are more than regular Print Size and they get moved over to second page. This causes the load process to fail. The command I am using is as below.

sudo libreoffice --headless --convert-to pdf --outdir ../excel/ filename.xls

I know you can chose Scaling Options if you are using GUI but we run this process during night and I want to avoid any human interaction.



edit retag flag offensive close merge delete


No, it isn't possible using command line. UNO programming or macro would be required.

Mike Kaganski gravatar imageMike Kaganski ( 2017-10-05 14:58:39 +0200 )edit

I see. Thank you for quick reply. Any way to print in landscape as opposed to portrait ?

sdeshpande gravatar imagesdeshpande ( 2017-10-05 15:01:25 +0200 )edit

When printing from command line, LibreOffice doesn't do any setup; it uses whatever settings are in file. So again, not possible without scripting.

Mike Kaganski gravatar imageMike Kaganski ( 2017-10-05 15:08:42 +0200 )edit

Thank you.

sdeshpande gravatar imagesdeshpande ( 2017-10-05 15:31:50 +0200 )edit


Will you be able to provide some guidance on this ? Sorry if this is something I should not be asking here in this forum.

Regards, Saurabh

sdeshpande gravatar imagesdeshpande ( 2017-10-05 18:51:17 +0200 )edit