Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Make soffice command of Libreoffice work on Mac OS X

Quick Start

sudo curl https://gist.githubusercontent.com/pankaj28843/3ad78df6290b5ba931c1/raw/soffice.sh > /usr/local/bin/soffice && sudo chmod +x /usr/local/bin/soffice

Create an bash script at /usr/local/bin/soffice with following content

#!/bin/bash

# Need to do this because symlink won't work
# It complains about some .plist files
/Applications/LibreOffice.app/Contents/MacOS/soffice "$@"

Make it executable

sudo chmod +x /usr/local/bin/soffice

Usage

Convert an excel file to pdf

soffice --headless --convert-to pdf:"calc_pdf_Export" /path/to/some/.xlsx/file
#!/bin/bash
# Need to do this because symlink won't work
# It complains about some .plist files
/Applications/LibreOffice.app/Contents/MacOS/soffice "$@"
@rootelement

This comment has been minimized.

Copy link

@rootelement rootelement commented Mar 24, 2016

Your paths are missing the L in local.

/usr/loca/bin/soffice

@kirtideshmukh

This comment has been minimized.

Copy link

@kirtideshmukh kirtideshmukh commented Nov 15, 2019

Does this work in latest version ? Because I am not able to locate soffice script under Applications

@florianeck

This comment has been minimized.

Copy link

@florianeck florianeck commented Mar 30, 2020

please change /usr/loca/ to /usr/local/ 😄

@dan-maximov

This comment has been minimized.

Copy link

@dan-maximov dan-maximov commented Jun 17, 2020

Please, change psjinx to your new nickname

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment