dvilj4, dvilj4l, dvilj2p, dvilj β convert a TeX DVI file to PCL, for HP LaserJet printers
| Use Case | Command | Description |
|---|---|---|
| Basic conversion | dvilj file.dvi | Converts DVI to PCL output file file.lj |
| Output to stdout | dvilj -e- file.dvi | Directs PCL output to standard output for piping |
| Double-sided printing | dvilj -D file.dvi | Prints even pages first, then odd pages (manual duplex) |
| Duplex unit printing | dvilj -d1 file.dvi | Uses printer duplex unit (long edge binding) |
| Page range selection | dvilj -f2 -t5 file.dvi | Prints only pages with TeX page numbers 2 through 5 |
| Set paper size | dvilj -s26 file.dvi | Selects A4 paper (210mm Γ 297mm) |
| Landscape mode | dvilj -l file.dvi | Prints in landscape orientation |
| Magnification | dvilj -m1 file.dvi | Uses magnification 1200 (equivalent to 1200 dpi) |
| Include PCL file | \special{hpfile=file.pcl} | Inserts PCL commands at current position |
| Include PostScript | \special{psfile=file.ps llx=0 lly=0 urx=100 ury=100 rwi=200} | Converts EPS via Ghostscript and inserts |
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).
--Dnumber β Debug according to the bits of number; see the kpathsea(3) manual for values. Also turns on general verbosity.-cnumber β π’ Print each page number times (including original).-dnumber β π Print in duplex mode. -d1 means long edge binding, -d2 stands for short edge binding. Only selectable in dvilj4 and dvilj2p.-D[-12] β π Doubleβsided printing β see below; -D1 prints odd sides only, -D2 is for even pages, a trailing - suppresses printing of empty padding pages.-E β π‘ Switch printer into econo mode (dvilj4 only).-eoutfile β π€ Send output to outfile instead of the basename of dvi file extended with ".lj". If outfile is - (as in "-e-") the output is directed to standard output and can be directly piped into a spooler.-fpagenum β π Print pages with TeX page numbers greater than or equal to pagenum.-g β π Go mode: do not reset printer at start of job.-hheaderfile β π Copy headerfile to output before translation of the DVI file. Used to send arbitrary commands to the laserprinter.-l β π Print output in landscape mode; supported only by dvilj2p and dvilj4.-Mflag β β οΈ Do (not) call mktexpk(1) to generate fonts on demand. -M1 and -M are equivalent. -M0 enables invoking mktexpk(1).-mmagnification β π Specify the magnification to use. Available: -m#900, -m0 (1000), -mh (1095), -m1 (1200), -mq (1250), -m2 (1440), -m3 (1728), -m4 (2074), -m5 (2488).-ppagecount β π Print pagecount pages after the starting page.-q β π€« Quiet operation: omit final statistics, etc.-r β π Toggle page reversal.-spagesize β π Specify the page size. See full list in the original man page (e.g., -s2 Letter, -s26 A4, -s27 A3, etc.).-tpagenum β π Print pages with TeX page numbers less than or equal to pagenum.-v β π’ Verbose mode: list fonts used, etc.-Vmode β π§ Compatibility mode. Use "K" for Kyocera, "B" for Brother, 6 for LJ6 printers.-w β π Omit warnings.-xoffset β π Global xβoffset in mm on output page relative to 1 inch/1 inch origin.-yoffset β π Global yβoffset in mm on output page relative to 1 inch/1 inch origin.-Xoffset β π Global xβoffset in dots on output page (overrides 1 inch/1 inch origin).-Yoffset β π Global yβoffset in dots on output page (overrides 1 inch/1 inch origin).-z β π§ͺ Print a test page with the page counter at end of job.If no operands are specified a brief usage message is displayed.
filename
The DVI file name that shall be converted by dvilj. It must always be seekable. The output file name is constructed from filename: either an extension ".dvi" is replaced by ".lj", or the extension ".lj" is appended. If filename is -, the DVI file is read from standard input and the resulting PCL document is written to standard output.
"\special" commands supported by dvilj have the 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 the equal sign are ignored. The value is either a space separated word, or a quoted string. Both double and single quotes can be used, alternatively. There is no support for quoting quote characters in values.
The following key/value combinations are valid:
hpfile=file β π Insert file at the current position. file is searched with kpathsea(3). The file content must be valid PCL or HPβGL/2. PCL absolute positioning escape sequences are rewritten to relative.hpfile_verbatim=file β π Insert file verbatim at the current position, without any changes. file is searched with kpathsea(3).psfile=file llx=x0 lly=y0 urx=x1 ury=y1 rwi=s β πΌοΈ Convert PostScript file file to HP PCL via Ghostscript (device "ljetplus") and insert the resulting graphics. The accompanying key/value pairs are mandatory. (Semantics not fully documented.)dvilj-psfile-syntax=syntax β βοΈ Where syntax is either "dvilj" or "ignore". Controls processing of subsequent psfile specials.comment=arbitrary text β π¬ Causes the rest of the special to be ignored. comment arbitrary text (without =) is also accepted.orientation=po β π Position the page on the physical paper. Values: 0 portrait, 1 landscape, 2 reverse portrait, 3 reverse landscape.defpoint=n(x,y) β π Define the point number n (0β79). x and y are positions relative to the DVI page origin. Can be omitted to use current position.resetpoints="all" β π Undefines all points.gray=gray_scale / grey=gray_scale β π¨ Sets the fill mode for the next fill special; area will be filled with gray color (0β100%). Only 8 distinct patterns available.pattern=pat β π¨ Sets the fill mode to a pattern. Values: 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=a/b β π¦ Fill the area between points a and b according to the current fill mode. Default: 10% gray.filename β β οΈ Legacy special (deprecated). If the special is just one word that names an existing file, that file is verbatim included. Not searched with kpathsea(3).The special parser sometimes accepts invalid constructs; output may be damaged.
Proper file include specials search the file with kpathsea(3). The search path is configured by variable DVILJINPUTS and, if the file is not found, by TEXINPUTS. "dvilj" is used as the ".PROGRAM" name in texmf.cnf for all driver variants.
Kpathsea(3) has the concept of warning suppression with the configuration variable TEX_HUSH. If "special" is among the listed values, dvilj does not output warnings about unknown specials. But recognized specials with invalid parameters still produce warnings.
If the printer has a duplex unit installed, duplex printing can be demanded with the -d option.
Otherwise, the command line option -D causes the printer to print in doublepage mode: first the even pages, then the odd pages. If -D is used without 1 or 2, after half the pages the printer stops and shows "FEED". The operator must feed the printed pages into the manual feeder or press continue.
If -D1 is specified only odd pages will be printed, -D2 for even pages. A trailing - (as in -D-, -D1- or -D2-) suppresses printing of empty padding pages.
The driver tries to be clever: when a document has an odd number of pages it inserts an empty page in the right place; when a document starts with page 0 the driver inserts an empty page after the 0βpage; when a piece of a document starts with an even page number it prints this page at the backside of the first page to ensure odd sides are always on the frontside.
The doubleside option works for all LJs, not only for the D model. Frequent use may require more frequent printer cleaning. The -pX option can be used to abort printing after X pages but may give strange results with -D.
dvilj uses the same environment variables and algorithms for finding font files as TeX and its friends. See the documentation for the kpathsea(3) library for details.
DVILJFONTS β Overrides all other font paths.DVILJMAKEPK β Overrides mktexpk(1) as the name of the command to execute to create a PK file.DVILJSIZES β May be set to indicate which sizes of fonts are available. List of numbers separated by colons. Decimals may be used for "pxl" files.DVILJINPUTS β Primary search path for include files.TEXINPUTS β Secondary search path for include files.TEX_HUSH β Colon separated list of identifiers that suppress warnings: checksum, readable, special, all, none.KPATHSEA_DEBUG β Trace kpathsea(3) lookups; set to -1 for complete tracing.GS_PATH β On Windows, path to Ghostscript (default gswin32c.exe). On Unix, not used; Ghostscript is called as gs(1).dvihp(1), dvicopy(1), dvips(1), xdvi(1), mktexpk(1), gs(1), kpathsea(3)
Email bug reports to tex-k AT tug.org.
Source is at http://mirror.ctan.org/dviware/dviljk/; for compilation the texk build environment is needed, from svn://tug.org/texlive/*/Build/source.
As of July 2007, PCL reference documentation is found at HP's Web site: http://h20000.www2.hp.com/bizsupport/TechSupport/Document.jsp?objectID=bpl04568. At the end of that page are links to reference manuals for PCL and PJL.
In case that page is changed, PDFs have the form http://h20000.www2.hp.com/bc/docs/support/SupportManual/bpl<ID>/bpl<ID>.pdf where <ID> is one of:
13205 β PCL 5 Technical Quick Reference Guide13210 and 13211 β PCL 5 Technical Reference Manual (part I and II)13208 and 13207 β PJL Technical Reference Manual (and addendum)13212 β PCL 5 Color Manual13206 and 13209 β Comparison Guide (and addendum)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.
Generated by phpman v4.9.26-5-g7740029 Author: Che Dong Under GNU General Public License
2026-08-14 21:44 @2600:1f28:365:80b0:4d23:66fa:c2bb:7bae
CrawledBy CCBot/2.0 (https://commoncrawl.org/faq/)