Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save rastandy/dffb923ce0a461cf4b7c0585c48c97d9 to your computer and use it in GitHub Desktop.
Save rastandy/dffb923ce0a461cf4b7c0585c48c97d9 to your computer and use it in GitHub Desktop.
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 "$@"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment