Printing to a remote printer
Every now and then I’ll enter the computer lab only to find that all the computers are being used – this usually happens when I urgently need to print something before I miss the bus. Thankfully, the system admins have allowed me the wonders of ssh access. So, printing is relatively simple: Copy the file […]
2 November 2009

Every now and then I’ll enter the computer lab only to find that all the computers are being used – this usually happens when I urgently need to print something before I miss the bus.
Thankfully, the system admins have allowed me the wonders of ssh access. So, printing is relatively simple:
Copy the file to be printed to the server.
scp filename.pdf username@server:.
List all available printers.
lpstat -a
Send your document to the printer.
lpr -Pprinter filename.pdf
Optionally, to save paper, you may print multiple pdf pages on one sheet.
The process is simple: convert the pdf to ps (postscript), use the psnup utility to increase the number of pages placed on each sheet, then convert the pdf to ps.
pdf2ps filename.pdf
psnup -n2 filename.ps (or 2up filename.ps to get two pages per sheet)
ps2pdf filename.ps