Last active
August 29, 2015 14:22
-
-
Save barryrowlingson/5a609113b79dc3540412 to your computer and use it in GitHub Desktop.
convert a bunch of docs to pdf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
for f in $* ; do | |
libreoffice "-env:UserInstallation=file:///tmp/LibO_Conversion" --headless --invisible --convert-to pdf "$f" | |
done | |
rm -rf /tmp/LibO_Conversion |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When converting documents from Libre/Open Office to PDF, it can connect to a running instance and then nothing happens on the command line. From http://ask.libreoffice.org/en/question/1686/how-to-not-connect-to-a-running-instance/ comes the
-env
trick of starting a new user installation. This script just does all the conversions in one go.Copy to a directory in your path and do:
and voila, three PDF versions. Splat them together with
pdftk *.pdf cat docs.pdf
and you have one thing to take to the meeting.