Print pdf files from bash
No Comments Yet so far
Leave a comment
Tired of manually doing pdf2ps and then lpr so you can print from the commandline. This bash function is the solution.
function printpdf ()
{
for i in $@; do
if [ "$1" != "$i" ]; then
dt=`date +%y%m%d%H%M%S`
pdftops $i temp-print${dt}.ps
lpr -P $1 temp-print${dt}.ps
rm temp-print${dt}.ps
fi
done
}
Usage:
printpdf printername file1.pdf file2.pdf file3.pdf ….
Leave a Comment
No Comments Yet so far
Leave a comment
Leave a comment
Line and paragraph breaks automatic, e-mail address never displayed, HTML allowed:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <pre> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>