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

5 comments:

Unknown 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

Anonymous said...


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

Anonymous said...


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

Anonymous said...

Here is Mr Benjamin contact Email details, 247officedept@gmail.com. /  Or Whatsapp +1 989-394-3740 that helped me with loan of 90,000.00 Euros to startup my business and I'm very grateful,It was really hard on me here trying to make a way as a single mother things hasn't be easy with me but with the help of Mr Benjamin put smile on my face as i watch my business growing stronger and expanding as well.I know you may surprise why me putting things like this here but i really have to express my gratitude so anyone seeking for financial help or going through hardship with there business or want to startup business project can see to this and have hope of getting out of the hardship..Thank You.