Calc export as PDF on server

Hi,
I am using Calc (actually soffice) in a headless manner (using —headless) to convert spreadsheets into PDF. I am running it on a server that doesn’t have X server and using JOD converter to communicate with soffice.

Generally it hasn’t been a problem, however when I export the spreadsheet to PDF, wide spreadsheets get truncated and take multiple pages which is not ideal.

However, when I run the same program on my local dev machine, which has X server running, the output PDF gets auto scaled and doesn’t break up into multiple pages.

Can you please direct me how to get auto scaling on server that doesn’t have X server running? When running in headless mode, what OS setting are picked up by LibreOffice. What do I need to set them on my server?

I have spent couple of days trying out different options, e.g. using Xvfb on my server, but to no avail.

Any help is appreciated.
TIA,

Sunil

Note: I have asked this question via support mailing list too. I’ll update if I receive answer over there and vice versa.

I think headless mode use the same settings as you have for export in the normal view.
Maybe you can tried to run the program once in the server an set up the options, or maybe copying the profile from the computer where works to the server.