Ask Your Question

Converting document in headless mode in Linux [closed]

asked 2013-03-15 18:57:46 +0200

lsl gravatar image

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?


edit retag flag offensive reopen merge delete

Closed for the following reason question is not relevant or outdated by Alex Kemp
close date 2015-11-08 08:53:59.593891

2 Answers

Sort by » oldest newest most voted

answered 2013-03-16 23:22:08 +0200

qubit gravatar image

updated 2013-03-16 23:25:17 +0200

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:

edit flag offensive delete link more

answered 2013-09-15 17:12:55 +0200

Till gravatar image

updated 2013-09-15 17:14:17 +0200

Just use

libreoffice --headless --invisible --convert-to pdf <filename>

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

edit flag offensive delete link more


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

Bob Myers gravatar imageBob Myers ( 2013-10-18 08:00:25 +0200 )edit

Question Tools


Asked: 2013-03-15 18:57:46 +0200

Seen: 15,953 times

Last updated: Sep 15 '13