Wednesday, April 18, 2007

Print pdf from command line ( Shell file )


#!/bin/csh
if( $# == 2 ) then
set printer=$2
else
set printer=$PRINTER
endif

if( $1 != "" ) then
cat ${1} | acroread -toPostScript | lpr -P $printer
echo ${1} sent to $printer ... OK!
else
echo PDF Print: No filename defined!
endif

4 comments:

Leila said...

For more heavy duty tools, there is also a commercial called JPDFPrintCLI, a command line tool to print PDF documents under Linux.

fasel said...

Just use

# lpr document.pdf

kevin clone said...


but lpr *.pdf is only valid if cups is installed with some sort/type of pdf support no!?

kevin clone said...


but lpr *.pdf is only valid if cups is installed with some sort/type of pdf support no!?