Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Linux piping ( convert -> pdf2ps -> lp)

Ok, so I can print a PDF doing:

pdf2ps file.pdf - | lp -s

But now I want to use convert to merge several PDF files, I can do this with:

convert file1.pdf file2.pdf merged.pdf

which merges file1.pdf and file2.pdf into merged.pdf, target can be replaced with '-'.

Question

How could I pipe convert into pdf2ps and then into lp though?

like image 915
alcohol Avatar asked Mar 24 '10 12:03

alcohol


1 Answers

convert file1.pdf file2.pdf - | pdf2ps - - | lp -s should do the job.

You send the output of the convert command to psf2ps, which in turn feeds its output to lp.

like image 108
tonio Avatar answered Sep 22 '22 08:09

tonio