javaunixlibreofficeheadlessjodconverter

Access Libre office headless service of Unix on windows


I am running Libre Office as a headless service on unix machine to convert xlsx files to ods. JODConverter library is used to connect to service.

The problem occurs when from Windows machine I try to convert the files. I am getting below exception

Caused by: com.sun.star.lang.IllegalArgumentException: Unsupported URL <C:%5CUsers%5Cshikhaha%5CDownloads%5CjOpenDocumentTest%5Cone.xlsx>: "from LoadEnv::initializeLoading"

The problem seems to be due to file path of windows. Any idea how can I connect to unix service from windows machine.

Thanks,

Hanumant


Solution

  • If you're just dealing with document conversion I would recommend not to run LibreOffice as a service. As of a couple of years ago it had memory leak issues, and required periodic restarts.

    I would do a command line document conversion which is pretty fast:

    $ time soffice --headless --convert-to odt:"calc8" q.xls 
    convert /tmp/q.xls -> /tmp/q.odt using calc8
    
    real    0m0.677s
    user    0m0.610s
    sys 0m0.055s