Skip to content

Instantly share code, notes, and snippets.

@talison
Created September 21, 2009 17:52
Show Gist options
  • Save talison/190404 to your computer and use it in GitHub Desktop.
Save talison/190404 to your computer and use it in GitHub Desktop.
#!/bin/bash
#
# Prints a file to PDF using OpenOffice and
# CUPS-PDF. Opens output file with evince doc
# viewer.
##
CUPS_HOME="$HOME/PDF"
file=`basename $1`
prefix=${file%.[^.]*}
outfile="${CUPS_HOME}/${prefix}.pdf"
echo Printing ${prefix}.pdf
soffice -norestore \
-nofirststartwizard \
-nologo \
-headless \
-pt PDF $1
echo Sleeping 10 seconds
sleep 10
echo Opening $outfile
evince "$outfile"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment