Viewing and Printing Certain File Types

Instructions for viewing files depend on the file type; see the appropriate section below. This web page describes how to view and print the following file types:

File ExtensionFile Type
dviTeX dvi file
pdf Adobe AcrobatTM Portable Document Format
psPostScript
eps Encapsulated PostScript
doc Microsoft WordTM document
rtf Microsoft Rich Text Format

This page cannot possibly give information on all of the file types that are out there. For files not of the above types, the following references may give a clue on how to view or print them:

When printing files, note that our printer software recognizes many file types automatically, such as PostScript, PDF, TeX dvi, and of course text. No special arguments (such as -d for dvi files) are needed; just send the file to the printer and the rest will happen automatically.

Viewing and Printing TeX dvi Files

Running TeX or LaTeX produces a dvi file in your current working directory.

To view a dvi file, use xdvi:

xdvi file.dvi

To print a dvi file, you can usually (as noted above) just send the file to the printer with the lpr command:

lpr -P744 file.dvi

However, if the document refers to other files (for example for included PostScript graphics), you will need to call dvips yourself:

dvips -P744 file.dvi

You can also use the dvips command to ask that only a subset of the pages be printed; for example:

dvips -P744 -pp 3-6,9,11 file.dvi

It is also possible to print from xdvi. Either click on the "Print" button on the right-hand side of the screen, or type Control-P in the main window. This will pop up a print dialog window.

Viewing and Printing PDF Files

To view a pdf file, use Acrobat reader:

acroread file.pdf

or xpdf:

xpdf file.pdf

or gv:

gv file.pdf

As noted above, you can print a PDF file using the lpr command, as in

lpr -P744 file.pdf

This effectively uses the same mechanism as the commands

pdf2ps file.pdf file.ps
lpr -P744 file.ps

If this doesn't work, you can also use Acrobat Reader, either by running acroread and printing the file using its print dialog, or from the command line via the following:

acroread -toPostScript < file.pdf | lpr -P744

Viewing and Printing PostScript (.ps) Files

To view a PostScript file, use Ghostview:

gv file.ps

To print such a file, just send it to the printer using lpr:

lpr -P744 file.ps

Be sure that the first two characters of the first line of the file are "%!"; otherwise the file will not be recognized as PostScript.

Viewing and Printing Encapsulated PostScript (.eps) Files

Encapsulated PostScript files are just a special type of PostScript files (most often used as figures incorporated into other documents). To view and print them, you can usually just follow the above instructions for regular PostScript files.

However, there is one exception. Sometimes an eps file will not have a showpage command at its end. If this is the case, then sending the file to the printer will not produce any output. To remedy this situation, process it with the eps2eps command:

eps2eps file.eps file2.eps
lpr -P744 file2.eps

Viewing and Printing Microsoft Word (.DOC) Files

You may often receive Microsoft Word files in e-mail attachments. These files usually end in .doc. They can be read and viewed with Star Office:

soffice file.doc

These files can also be printed from Star Office. Either type Control-P, or click on the printer icon to pop up a print dialog box. Select the printer from the drop-down menu, make any other selections you wish, and then click OK.

Viewing and Printing Rich Text (.RTF) Files

For .rtf files, follow the same directions as for .doc files, above:

soffice file.rtf

Last updated 4 March 2010