OOo needs a display to run. The only way to run it without a real one is to substitute a Xvfb for a real display. There is a -headless command line option but it doesn’t do much useful for us. There is also -invisible to avoid any visual window and dialogs to be created but a display is nevertheless still required.
On the other hand we have a vcl plug architecture which allows swapping in different toolkit backends, so it’s not a big leap to put in a headless backend which just defaults to some things sufficiently good enough to not need to open a display connection but to still find local fonts. Useful for me for headless build system side tests, useful for others for web server backend document conversion.
And actually looking at the -headless option I see that this is what this is intended to do, i.e. to open a vclplug backend called svp which doesn’t exist for OOo. That does sort of imply that one exists for StarOffice [flawed differentiator thinking(?)].
Anyway, I’ve cooked up a quick and dirty pastefest headless patch to introduce a libvclplug_svp backend which works sufficiently well for me to get OOo to load and save documents to other formats (including pdf) from the commandline without a DISPLAY. e.g.
/usr/lib/openoffice.org/program/soffice.bin -headless "-accept=socket,host=localhost,port=2002;urp;"
and run a command uno program against it to load and save documents to other formats including .pdf. Needs some work to remove cut and paste foo and investigation if the rest of the stubs need to be filled out.