Created
September 21, 2009 17:52
-
-
Save talison/190404 to your computer and use it in GitHub Desktop.
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/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