Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Print in landscape mode from the command line' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Print in landscape mode from the command line
Authored by: kirkmc on May 22, '03 11:42:22AM

... and enscript looks like it only works with PostScript printers...

Kirk



[ Reply to This | # ]
Print in landscape mode from the command line
Authored by: Han Solo on May 22, '03 09:04:10PM
Yes, but with one other tool, you could create a PDF file from the command line (including in landscape mode if desired) and then print that to any printer.

First, use -pfilename instead of -Pprintername. This will write the output to a PostScript file.

Next, use ps2pdf to convert your newly created filename.ps to filename.pdf. ps2pdf is available from numerous places, including as part of a GhostScript install (or via Fink).

Finally, use regular old lpr to print the PDF file you created in the second step.

[ Reply to This | # ]

Print in landscape mode from the command line
Authored by: RalfM on May 22, '03 10:53:14PM
enscript -DDuplex:true -ptestfile.ps testfile ; ps2pdf testfile.ps testfile.pdf ; lpr testfile.pdf

vs

lp -o landscape testfile

?

Hmmm... what to choose?

I agree with an earlier post. Read the cups manpage.

[ Reply to This | # ]

Print in landscape mode from the command line
Authored by: eredhuin on May 22, '03 11:02:12PM

I fiddled briefly and came up with the one-liner

enscript -h -r -G -E -2 --color -i 2 -fCourier7 -o - fwdtest.cpp | ps2pdf - | lpr

Then I create a script in ~/bin/lprint.sh

#!/bin/sh
for k in $* ; do
enscript -h -r -G -E -2 --color -i 2 -fCourier7 -o - $k | \
ps2pdf -|lpr
done

and made it executable

chmod +x ~/bin/lprint.sh



[ Reply to This | # ]