Since hidden behind your pdf2ps
command there is a Ghostscript command running (which accomplishes the PDF -> PS conversion), you could also run Ghostscript directly to generate the PostScript:
gs -o output.ps \
-sDEVICE=ps2write \
file1.pdf \
file2.pdf \
file3.pdf ...
Note, that older GS releases didn't include the ps2write
device (which generates PostScript Level 2), but only pswrite
(which generates the much larger PostScript Level 1). So change the above parameter accordingly if need be.
Older Ghostscript versions may also need to replace the modern abbreviation of -o -
with the more verbose -dNOPAUSE -dBATCH -sOutputFile=/dev/stdout
. Only newer GS releases (all after April 2006) know about the -o
parameter.
Now, to directly pipe the PostScript output to the lp
command, you would have to do this:
gs -o - \
-sDEVICE=ps2write \
file1.pdf \
file2.pdf \
file3.pdf ... \
| lp -s <other-lp-options>
This may be considerably faster than running pdftk
first (but this also depends on your input files).