hplj Command

Purpose

Postprocesses the troff command output for the HP LaserJet Series printers.

Syntax

hplj [ -F Directory ] [ -quietly ] [ -landscape ] [ File ... ]

Description

The hplj command processes the output of the troff command for output to Hewlett-Packard LaserJet Series printers.

If given one or more files as options, the hplj command processes those files. If no files are specified, it acts as a filter interpreting standard input. The parameter File specifies files the hplj command processes to output on an HP Laser Jet Series printer.

Note: The hplj command can use the K cartridge or Text-Equations cartridge if installed in the printer. (The Text-Equations cartridge, HP part number C2053A #C07, supersedes the K cartridge.) The default font files assume one of the cartridges is installed. If you do not have a K cartridge, use the downloaded bit-mapped fonts instead. To do this, run the no_cart shell script in the font directory for the HP printer (/usr/lib/font/devhplj).

Incorrect output can occur if your font files assume either cartridge is mounted when it is not. Incorrect output can also occur if other cartridges or soft fonts are installed, in addition to the K cartridge or Text-Equations cartridge.

The hplj command depends on the files with names ending in .out in the /usr/lib/font/devhplj file. This command does not produce reasonable output unless these files have been properly set up. See the troff font file format document for more information.

Flags

Item Description
-FDirectory Identifies the specified directory as the place to find the font file. By default, the hplj command looks for font files in the /usr/lib/font/devhplj directory.
-quietly Suppresses all nonfatal error messages.
Item Description
-landscape Prints the specified file in landscape format. A landscape page is oriented so that for normal reading, the width of the page is greater than its length. By default, the hplj command prints in portrait orientation.
Note: Landscape is only available in the Courier font on the Hewlett-Packard Jet II printer. Therefore, troff documents must be formatted in the Courier font. To accomplish this, insert the following lines at the beginning of the troff input file:
.fp 1 C
.fp 2 C
.fp 3 CB

The Courier font is loaded onto font positions #1 & #2 and Courier-Bold onto position #3.

Examples

  1. To print a troff file named foo on the printer called hp using the lp command, enter:
    troff -mm -Thplj foo | hplj | lp -dhp -o -dp
  2. To print a troff file named boo on printer called hp using the qprt command, enter:
    troff -mm -Thplj boo | hplj | qprt -dp -Php
    Note: The -dp flag in both examples sends the printer data to the print device in pass-through (unmodified) mode.

File

Item Description
/usr/lib/font/devhpl/*.out Contains font files.