Printing and PDF Documents on CSLab Systems

Finding printers near you

Type lpstat -v at the command line on an apps machine to find a list of printers that you have access to use.

Changing your default printer

To find out your default printer, from the command line, type: echo $PRINTER

To temporarily change your default printer, type: setenv PRINTER printer_name

Type: echo $PRINTER to make sure that the new printer settings have taken place.
This setting will only last until you logoff.

To permanently change your default printer - find out what shell your using. Type: echo $SHELL

If you are using the default shell /bin/tcsh you will need to edit the .cshrc file.

****Edit this file at your own risk. Always make a Backup.****

In the .cshrc file find the following:

# The file /etc/printcap lists available printers.
# Here's how to change the default printer:
setenv PRINTER Printer_name

Change the Printer_name to the name of the printer you want to be the new default.

Printing From the command line

lpr print_job will print to your default printer.

For example: lpr todolist prints a file called todolist, to your default printer.

lpr -Pname_of_printer print_job sends a print job to a printer of your choosing.

For Example: lpr -Plw-567 todoloist prints todolist to a printer called lw-567.

lpq shows the print queue for your default printer. For example:

lw-staff is ready and printing
Rank    Owner   Job     File(s)                         Total Size
active  jerrykr 73514   file.ps                         218112 bytes

This shows that the owner jerrykr has a file called file.ps in the print queue. It is job number 73514.

lpq -PPrinter-name shows the print queue for a specified printer.

For example: lpq -Plw-456 shows the print queue for a printer called lw-456.

lprm job# removes a job from the print queue. You can only remove jobs from the print queue that you have sent.

For example: to cancel the document file.ps in the above lpq example, I would see that the job number was 73514 and type lprm 73514

Printing PDFs from Acroread

To view PDF documents type: acroread Name_of_PDF_File. To print from within acroread to your default printer select File on the top left corner and from the drop down menu select Print.

To print to another printer (other than your default) select File then Print. In the Printer Command dialogue box it will say /local/bin/lpr, at the end of this type -Pname_of_printer . For example if you wanted to print to lw-567 it would read /local/bin/lpr -Plw-567

Problematic PDF Documents

There are some PDF documents that for some reason will not print from acroread. If this occurs try the pdf2ps binary which converts PDF documents to postscript.

From the command line type: pdf2ps Name_of_PDF.pdf Name_of_Postscript.ps

This renames and converts a PDF file to postcript. Make sure you use the .pdf and .ps extensions when you type the name of the documents.

For example: to convert a file called test.pdf to a file called test.ps you would type: pdf2ps test.pdf test.ps

Once the file has been converted to postscript use the lpr command from a command line to print the document.

Defeated - try a Windows Box

Unfortunately, there seems to be a few documents that just do not want to print from CSlab machines. If you have a laptop running Windows, this might be your best solution for extremely problematic PDF files.