dvilj4, dvilj4l, dvilj2p, dvilj - convert a TeX DVI file to PCL, for HP LaserJet printers
| Use Case | Command | Description |
|---|---|---|
| Basic conversion | dvilj4 file.dvi | Convert DVI to PCL, output file.lj |
| Send output to stdout | dvilj4 -e- file.dvi | Pipe output directly to spooler |
| Print multiple copies | dvilj4 -c3 file.dvi | Print each page 3 times |
| Duplex printing (hardware) | dvilj4 -d1 file.dvi | Long edge binding duplex |
| Double-sided (manual) | dvilj4 -D file.dvi | Print even pages, then odd |
| Select paper size | dvilj4 -s26 file.dvi | A4 paper size |
| Landscape mode | dvilj4 -l file.dvi | Landscape orientation |
| Page range | dvilj4 -f10 -t20 file.dvi | Print pages 10-20 |
| Magnification | dvilj4 -m1200 file.dvi | Scale to 1200 dpi equivalent |
| Quiet mode | dvilj4 -q file.dvi | Suppress final statistics |
| Include PCL file | Inside TeX: \special{hpfile=logo.pcl} | Insert PCL commands at current position |
dvilj [--Dnumber] [-ccopies] [-dmode] [-D] [-E] [-eoutputfile]
[-ffrompage] [-g] [-hheaderfile] [-l] [-Mflag] [-mmag] [-ppages]
[-q] [-r] [-ttopage] [-spagesize] [-v] [-Vmode] [-w] [-xxoff(mm)]
[-yyoff(mm)] [-Xxoff(dots)] [-Yyoff(dots)] [-z] [filename]
dvilj and siblings convert TeX-output ".dvi" files into PCL (the Hewlett-Packard Printer Control Language) commands suitable for printing on a HP LaserJet+, HP LaserJet IIP (using dvilj2p), HP LaserJet 4 (using dvilj4), and fully compatible printers.
dvilj4 also provides support for the builtin Intellifont and TrueType fonts; TFM and VF files are provided in the distribution. Virtual fonts are not supported directly by dvilj, so you must run dvicopy(1) first, or otherwise expand the virtual fonts.
All programs are generated from one source file dvi2xx.c. They are usually called via a shell script or as a line printer filter. One such script, dvihp(1), is included in the distribution. It provides command-line options similar to those of dvips(1).
-m#900 for user mag, -m0 = 1000, -mh = 1095, -m1 = 1200, -mq = 1250, -m2 = 1440, -m3 = 1728, -m4 = 2074, -m5 = 2488.-s1 Executive, -s2 Letter, -s3 Legal, -s6 Ledger, -s25 A5, -s26 A4, -s27 A3, -s45 JIS B5, -s46 JIS B4, -s71 Hagaki, -s72 Oufuku-Hagaki, -s80 Monarch Envelope, -s81 Com10 Envelope, -s90 DL, -s91 C5, -s100 B5 (ISO).K for Kyocera, B for Brother, 6 for LJ6.If no operands are specified a brief usage message is displayed.
\special commands have generic syntax:
\special{key1=value key1="value with space"}
\special{key3 = value key4 = 'note optional spaces around equal sign'}
Specials are a sequence of key/value pairs separated by an equal sign. Spaces around equal sign are ignored. Value is either a space-separated word or a quoted string (double or single quotes). No quoting of quote characters in values.
Valid key/value combinations:
Insert file at current position. File searched with kpathsea(3). File must contain PCL escape sequences or HP-GL/2 commands. Absolute PCL positioning is rewritten to relative.
Insert file verbatim without changes. File searched with kpathsea(3). Used to keep absolute positions.
Convert PostScript file to HP PCL via Ghostscript (device "ljetplus") and insert at current position. Mandatory keys: llx, lly, urx, ury, rwi (all integers). Note: Exact semantics of rwi and corner dimensions are unclear; please report if you know.
Where syntax is "dvilj" or "ignore". Crude control over psfile processing. "ignore" skips subsequent psfile specials; "dvilj" processes them. Only effective on the same page as the psfile special.
Rest of special is ignored. Used for meta-information. Second form is for compatibility.
Position page on physical paper: 0 = portrait, 1 = landscape, 2 = reverse portrait, 3 = reverse landscape.
Define point number n (0-79). x and y are in pt relative to DVI page origin (1in,1in upper left, altered by -x, -y, -X, -Y but not by \hoffset/\voffset). Can be omitted to use current position.
Undefine all points.
Set fill mode for next fill special. gray_scale is percentage (0=white, 100=black). PCL shading patterns: only 8 patterns available: 1-2% (1-2), 3-10% (3-10), 11-20% (11-20), 21-35% (21-35), 36-55% (36-55), 56-80% (56-80), 81-99% (81-99), 100%.
Set fill mode for next fill. pat: 1=horizontal lines, 2=vertical lines, 3=diagonal (lower left to upper right), 4=diagonal (upper right to lower left), 5=crossed vertical, 6=crossed diagonal.
Fill area between points a and b according to current fill mode. a must be upper left corner, b lower left corner. Default fill mode: 10% gray.
Deprecated. If special is just one word naming an existing file, that file is included verbatim (not searched via kpathsea). Do not use.
Note: The special parser sometimes accepts invalid constructs, leading to output damage.
Proper file include specials search with kpathsea(3). Search path: "DVILJINPUTS" first, then "TEXINPUTS". Program name in texmf.cnf is "dvilj" for all variants.
Kpathsea(3) has "TEX_HUSH" variable to suppress warnings. If "special" is listed, no warnings about unknown specials. But invalid parameters on recognized specials still warn.
If the printer has a duplex unit, use -d. Otherwise, -D enables doublepage mode (print even pages then odd pages). With -D (no number), after half pages printer stops with "FEED" message. Use manual feed or continue button.
Works for all LJs, not only D models. Cautions: frequent use may require more printer cleaning. Use -p to abort after X pages (risky with -D). Prefer -f and -t for partial printing.
dvilj uses same environment variables as TeX for font finding (see kpathsea(3)).
dvihp(1), dvicopy(1), dvips(1), xdvi(1), mktexpk(1), gs(1), kpathsea(3)
Email bug reports to tex-k AT tug.org.
Source: http://mirror.ctan.org/dviware/dviljk/ (needs texk build environment).
PCL reference documentation: HP website at http://h20000.www2.hp.com/bizsupport/TechSupport/Document.jsp?objectID=bpl04568. Also PDFs at http://h20000.www2.hp.com/bc/docs/support/SupportManual/bpl<ID>/bpl<ID>.pdf where is:
dvi2xx by Gustaf Neumann, Wirtschaftsuniversitaet Wien.
dviljk fork by Karl Berry.
Joachim Schrod <jschrod AT acm.org> supplied security fixes and updated this man page.
dvi2xx is public domain software. dviljk changes are covered by the GNU General Public License.
Version 2.6p5, 2012-03-12
Generated by phpman v4.10.0-7-g98e9fd5 · Markdown · JSON · MCP Author: Che Dong Under GNU General Public License
2026-09-03 16:16 @216.73.216.51
CrawledBy Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)