LinuxCommandLibrary

grolj4

Convert PostScript to PCL for LJ4 printers

SYNOPSIS

grolj4 [-c] [-d[num]] [-F dir] [-h] [-l] [-n num] [-o list] [-p paper] [-s size] [-v] [-w width] [files...]

PARAMETERS

-c
    Enable page length classification (short ≤11in or long >11in)

-d[num]
    Set duplex mode; num ≥1 enables long-edge duplex

-F dir
    Specify directory for font files

-h
    Use legacy 'HP' fonts instead of 'HPJL' fonts

-l
    Landscape page orientation

-n num
    Start numbering pages from num

-o list
    Output only pages in comma-separated list (e.g., 1,3-5)

-p paper
    Set paper size (e.g., letter, legal, a4, executive)

-s size
    Size of symbol font (e.g., 11, 12)

-v
    Print version information and exit

-w width
    Page width in characters

DESCRIPTION

grolj4 is a specialized driver for the groff typesetting system that generates PCL5 output suitable for HP LaserJet 4, LaserJet 4 Si, LaserJet 4 P, and LaserJet 4 V printers, as well as compatible models.

It functions as a wrapper script, invoking groff with the -Tlj4 device specification to process input files containing troff, nroff, or groff markup. The driver handles preprocessing for elements like tables (tbl), equations (eqn), and pictures (pic), producing binary printer-ready streams.

Key features include automatic page length classification (short ≤11in or long >11in), support for duplex printing modes, landscape orientation, custom paper sizes, and font scaling. Output supports scalable fonts from the HPJL family by default, with an option for legacy HP fonts.

grolj4 is ideal for legacy printing workflows but requires PCL5-compatible hardware. It pipes output directly to printers via lpr or files for later use, preserving high-quality text, graphics, and layout fidelity from groff documents.

CAVEATS

Produces binary PCL5 output; requires compatible printers. Landscape mode may need adjusted margins. Deprecated for modern PostScript/PDF workflows.

USAGE EXAMPLE

Process man page source:
grolj4 /usr/share/man/man1/ls.1 | lpr -P lj4

Landscape A4 duplex:
grolj4 -l -p a4 -d1 document.ms > output.pcl

HISTORY

Introduced in early GNU groff (1990s) as part of printer-specific drivers for legacy dot-matrix and LaserJet support. Maintained for compatibility but less used post-2000s.

SEE ALSO

groff(1), grolj4(1), grops(1), grodvi(1)

Copied to clipboard