Converting document in headless mode in Linux

I’m trying to convert documents on a Linux box in headless mode using:
soffice -headless -convert-to pdf test.xlsx

I get the error message:

/usr/lib64/libreoffice/program/soffice.bin X11 error: Can’t open display:
Set DISPLAY environment variable, use -display option
or check permissions of your X-Server
(See “man X” resp. “man xhost” for details)

I just want to do batch conversion – I don’t want a GUI. What can I do to get this to silently convert files?

Thanks!

Hi @lsl,

Please take a look at the question and wiki page here:

I thought that this “truly headless” work had been merged into master, but perhaps not yet…


Another option might be to use Xvfb as an X-server stub:

Just use

libreoffice --headless --invisible --convert-to pdf

that is, each option is preceded by two minus signs.

For me, using --headless prevents Japanese in .docx files from converting correctly. Characters are converted into square boxes.