Debian Codegraph @

texk/dviljk/dvilj.pod

raw
1 =head1 NAME
2
3 dvilj4, dvilj4l, dvilj2p, dvilj - convert a TeX DVI file to PCL, for HP LaserJet printers
4
5 =head1 SYNOPSIS
6
7 dvilj [--Dnumber] [-ccopies] [-dmode] [-D] [-E] [-eoutputfile]
8 [-ffrompage] [-g] [-hheaderfile] [-l] [-Mflag] [-mmag] [-ppages]
9 [-q] [-r] [-ttopage] [-spagesize] [-v] [-Vmode] [-w] [-xxoff(mm)]
10 [-yyoff(mm)] [-Xxoff(dots)] [-Yyoff(dots)] [-z] [filename]
11
12 =head1 DESCRIPTION
13
14 B<dvilj> and siblings convert TeX-output C<.dvi> files into PCL (the
15 Hewlett-Packard Printer Control Language) commands suitable for
16 printing on a HP LaserJet+, HP LaserJet IIP (using B<dvilj2p>), HP
17 LaserJet 4 (using B<dvilj4>), and fully compatible printers.
18
19 B<dvilj4> also provides support for the builtin Intellifont and
20 TrueType fonts; TFM and VF files are provided in the distribution.
21 Virtual fonts are not supported directly by B<dvilj>, so you must run
22 dvicopy(1) first, or otherwise expand the virtual fonts
23
24 All programs are generated from one source file F<dvi2xx.c>. They are
25 usually called via a shell script or as a line printer filter. One
26 such script, dvihp(1), is included in the distribution. It provides
27 command-line options similar to those of dvips(1).
28
29
30 =head1 OPTIONS
31
32 =over
33
34 =item B<--D>I<number>
35
36 Debug according to the bits of I<number>; see the kpathsea(3) manual
37 for values. Also turns on general verbosity.
38
39 =item B<-c>I<number>
40
41 Print each page I<number> times (including original)
42
43 =item B<-d>I<number>
44
45 print in duplex mode. The option B<-d1> means long edge binding,
46 B<-d2> stands for short edge binding. This option is only selectable
47 in B<dvilj4> and B<dvilj2p>.
48
49 =item B<-D>I<[-12]>
50
51 Double-sided printing - see below; B<-D1> prints odd sides only,
52 B<-D2> is for even pages, a trailing B<-> suppresses printing of empty
53 padding pages.
54
55 =item B<-E>
56
57 Switch printer into econo mode (B<dvilj4> only).
58
59 =item B<-e>I<outfile>
60
61 Send output to F<outfile> instead of the basename of dvi file extended
62 with C<.lj>. If outfile is B<-> (as in C<-e->) the output is directed
63 to standard output and can be directly piped into a spooler.
64
65 =item B<-f>I<pagenum>
66
67 Print pages with TeX page numbers greater than or equal to I<pagenum>.
68
69 =item B<-g>
70
71 I<Go> mode: do not reset printer at start of job.
72
73 =item B<-h>I<headerfile>
74
75 Copy F<headerfile> to output before translation of the DVI file. Used
76 to send arbitrary commands to the laserprinter.
77
78 =item B<-l>
79
80 Print output in landscape mode; supported only by B<dvilj2p> and
81 B<dvilj4>.
82
83 =item B<-M>I<flag>
84
85 Do (not) call mktexpk(1) to generate fonts on demand. B<-M1> and B<-M>
86 are equivalent. B<-M0> enables invoking mktexpk(1). (This is the same
87 as in dvips(1).) The default behavior (i.e., if no B<-M> option is
88 given) is chosen at compile-time; as distributed, mktexpk is enabled.
89
90 =item B<-m>I<magnification>
91
92 Specify the magnification to use. The following are available:
93
94 -m#usermag e.g., #900
95 -m0 equivalent to -m#1000
96 -mh equivalent to -m#1095
97 -m1 equivalent to -m#1200
98 -mq equivalent to -m#1250
99 -m2 equivalent to -m#1440
100 -m3 equivalent to -m#1728
101 -m4 equivalent to -m#2074
102 -m5 equivalent to -m#2488
103
104 =item B<-p>I<pagecount>
105
106 Print I<pagecount> pages after the starting page.
107
108 =item B<-q>
109
110 Quiet operation: omit final statistics, etc.
111
112 =item B<-r>
113
114 Toggle page reversal.
115
116 =item B<-s>I<pagesize>
117
118 Specify the page size:
119
120 -s1: Executive (7.25" x 10.5")
121 -s2: Letter (8.5" x 11")
122 -s3: Legal (8.5" x 14")
123 -s6: Ledger (11" x 17")
124 -s25: A5 paper (148mm x 210mm)
125 -s26: A4 paper (210mm x 297mm)
126 -s27: A3 (297mm x 420mm)
127 -s45: JIS B5 paper (182mm x 257mm)
128 -s46: JIS B4 paper (250mm x 354mm)
129 -s71: Hagaki postcard (100mm x 148mm)
130 -s72: Oufuku-Hagaki postcard (200mm x 148mm)
131 -s80: Monarch Envelope (3 7/8" x 7 1/2")
132 -s81: Commercial Envelope 10 (4 1/8" x 9 1/2")
133 -s90: International DL (110mm x 220mm)
134 -s91: International C5 (162mm x 229mm)
135 -s100: International B5 (176mm x 250mm)
136
137 These values are from the PCL 5 technical reference manual. If the
138 B<-s> commandline option is omitted, no clipping is performed at the
139 bottom of the page. (But printing below the paper bottom should not
140 disturb any correctly behaving PCL printer.) Please remember that the
141 correct paper tray must be installed for selected paper size, so use
142 this option only if you have full control over your print destination.
143
144 =item B<-t>I<pagenum>
145
146 Print pages with TeX page numbers less than or equal to I<pagenum>.
147
148 =item B<-v>
149
150 Verbose mode: list fonts used, etc.
151
152 =item B<-V>I<mode>
153
154 Compatibility mode. As I<mode>, use C<K> for Kyocera, C<B> for
155 Brother, C<6> for LJ6 printers.
156
157 =item B<-w>
158
159 Omit warnings.
160
161 =item B<-x>I<offset>
162
163 Global x-offset in mm on output page relative to 1 inch/1 inch origin.
164
165 =item B<-y>I<offset>
166
167 Global y-offset in mm on output page relative to 1 inch/1 inch origin.
168
169 =item B<-X>I<offset>
170
171 Global x-offset in dots on output page (overrides 1 inch/1 inch
172 origin).
173
174 =item B<-Y>I<offset>
175
176 Global y-offset in dots on output page (overrides 1 inch/1
177 inch origin).
178
179 =item B<-z>
180
181 Print a test page with the page counter at end of job.
182
183 =back
184
185
186 =head1 OPERANDS
187
188 If no operands are specified a brief usage message is displayed.
189
190 =over
191
192 =item I<filename>
193
194 The DVI file name that shall be converted by B<dvilj>. It must always
195 be seekable.
196
197 The output file name is constructed from I<filename>. Either an
198 extension C<.dvi> is replaced by C<.lj>, or the extension C<.lj> is
199 appended.
200
201 If I<filename> is B<->, the DVI file is read from standard input and
202 the resulting PCL document is written to standard output. (Please
203 remember that the DVI file must be seekable, even if it's stdin.)
204
205 =back
206
207
208 =head1 SUPPORTED TeX \special COMMANDS
209
210 C<\special> commands supported by B<dvilj> have the generic syntax
211
212 \special{key1=value key1="value with space"}
213 \special{key3 = value key4 = 'note optional spaces around equal sign'}
214
215 I.e., specials are a sequence of key/value pairs, separated by an
216 equal sign. Spaces around the equal sign are ignored. The value is
217 either a space separated word, or a quoted string. Both double and
218 single quotes can be used, alternatively. There is no support for
219 quoting quote characters in values; if you want both double and single
220 quotes in one value, you're out of luck.
221
222 The following key/value combinations are valid:
223
224 =over
225
226 =item B<hpfile>=I<file>
227
228 Insert I<file> at the current position. I<file> is searched with
229 kpathsea(3), see below.
230
231 The file content must be valid for this printer, i.e., it should
232 contain PCL escape sequences or HP-GL/2 commands. If the file is a
233 graphics file, this typically means that the upper left corner of the
234 graphics is placed at the current position.
235
236 PCL absolute positioning escape sequences in I<file> are rewritten to
237 be relative positioning commands; the lowest appearing coordinate is
238 used as reference.
239
240 =item B<hpfile_verbatim>=I<file>
241
242 Insert I<file> verbatim at the current position, without any changes
243 of the file content. I<file> is searched with kpathsea(3), see below.
244
245 This is mostly used to keep absolute positions in PCL files.
246
247 =item B<psfile>=I<file> B<llx>=I<x0> B<lly>=I<y0> B<urx>=I<x1> B<ury>=I<y1> B<rwi>=I<s>
248
249 Convert PostScript file I<file> to HP PCL, by Ghostscript with device
250 C<ljetplus>, and insert the resulting graphics file at the current
251 position, rewriting absolute position escape sequences. I<file> is
252 searched with kpathsea(3), see below.
253
254 The accompanying key/value pairs are mandatory, they can be specified
255 in an arbitrary order. Values I<x0>, I<x1>, I<y0>, I<y1>, and I<s> are
256 integers. (I<x0>,I<y0>) is the lower left corner, (I<x1>,I<y1>) the
257 upper right corner of the image.
258
259 B<Please note: The specific semantics of this special is not known.>
260 In particular, the B<rwi> parameter is some scale factor; but even
261 looking at the source code it is not quite clear what the special's
262 author intended to implement here. In addition, it is unclear what
263 dimensions are used to specify the corners, PostScript points or PCL
264 dots.
265
266 I<If you happen to know the psfile semantics, or if you spent the work
267 analyzing them, please inform us at [email protected], so that we can
268 update this man page with the relevant information.>
269
270 =item B<dvilj-psfile-syntax>=I<syntax>
271
272 where I<syntax> is either C<dvilj> or C<ignore>. This is a very crude
273 way to tell the driver what to do with B<psfile> specials.
274
275 If the value is C<ignore>, all B<psfile> specials that are processed
276 afterwards are ignored, until the next B<dvilj-psfile-syntax> special is
277 processed.
278
279 If the value is C<dvilj>, B<psfiles> specials are processed as
280 explained above, until the next B<dvilj-psfile-syntax> special is
281 processed.
282
283 An obvious, planned, extension is the value C<dvips>, but this has not
284 been implemented yet.
285
286 That special is not as simple as it sounds at first. Since its
287 semantics is defined by processing order, it is only of use if it is
288 placed on the same page as the B<psfile> special. Having it once in a
289 file (e.g., on the first page) does not help if you print just one
290 page of the document -- B<dvilj> does not do prescanning of first-page
291 specials like some other drivers do. (Patches would be welcome, of
292 course.)
293
294 =item B<comment>=I<arbitrary text>
295
296 =item B<comment> I<arbitrary text>
297
298 This causes the rest of the special to be ignored; it may be used to
299 add meta-information to a DVI file.
300
301 With the first form, the comment may appear anywhere in the special.
302 When it appears first, the processing of this special is terminated
303 and all other text behind is ignored.
304
305 The second form is a speciality that has been introduced for
306 compatibility with other drivers. If the first keyword of the special
307 is B<comment> and has no value, it is taken as a valid comment syntax,
308 too; the rest of the special is ignored.
309
310 =item B<orientation>=I<po>
311
312 Position the page on the physical paper. The value I<po> may be one of
313 the following values:
314
315 0 for portrait
316 1 for landscape
317 2 for reverse portrait
318 3 for reverse landscape
319
320 =item B<defpoint>=I<n(x,y)>
321
322 Define the point number I<n>. This point can be referred to later in
323 other special commands to specify areas that shall be filled with some
324 pattern. I<n> must be between 0 and 79.
325
326 I<x> and I<y> are the position of that point and have the form C<?pt>
327 where C<?> is a floating point number. The positions are relative to
328 the DVI page origin; i.e., coordinates increase moving right and down,
329 the point of origin is (1in,1in) in the upper left corner, altered by
330 options B<-x>, B<-y>, B<-X>, and B<-Y>, but not by \hoffset and
331 \voffset.
332
333 I<x> and I<y> can be omitted, i.e., the values C<3> or C<4(,)> are
334 valid. Then the current page position is used as position for point
335 I<n>.
336
337 =item B<resetpoints>=C<all>
338
339 This undefines all points again.
340
341 =item B<gray>=I<gray_scale>
342
343 =item B<grey>=I<gray_scale>
344
345 This sets the fill mode for the next B<fill> special, the area will be
346 filled with gray color. (B<grey> is an alias for B<gray>.) Any pattern
347 specification is reset.
348
349 I<gray_scale> is the percentage of gray that shall be used here; with
350 C<0> meaning white and C<100> meaning black.
351
352 Caveat: That special is actually a misnomer. PCL names these gray
353 scales I<shading patterns> and they are created by placing dots in the
354 area. The gray scale selects how far spread the dots are. In the lower
355 ranges, this doesn't look very gray on close sight, but more like a
356 dotted background. Furthermore, the gray scales are not as
357 fine-grained as the value range 0..100 might make you believe. In
358 reality, there are only 8 different gray patterns available:
359
360 1 - 2%
361 3 - 10%
362 11 - 20%
363 21 - 35%
364 36 - 55%
365 56 - 80%
366 81 - 99%
367 100%
368
369 One of these patterns is selected according to the I<gray_scale> value.
370
371 =item B<pattern>=I<pat>
372
373 This sets the fill mode for the next B<fill> special, the area will be
374 filled with a pattern. Any gray color specification is reset.
375
376 I<pat> is one of the following values:
377
378 1 horizontal lines
379 2 vertical lines
380 3 diagonal lines, from lower left corner to upper right corner
381 4 diagonal lines, from upper right corner to lower left corner
382 5 crossed lines, vertically
383 6 crossed lines, diagonally
384
385 =item B<fill>=I<a/b>
386
387 Fill the area between the points I<a> and I<b>, according to the
388 current fill mode.
389
390 Point I<a> B<must> be the upper left corner and point I<b> B<must> be the
391 lower left corner of the rectangle. Otherwise the result is garbage.
392
393 The default fill mode is 10% gray color filling.
394
395 =item I<filename>
396
397 This is a legacy special, its use is depreciated. If the special is
398 just one word that names an existing file, that file is verbatim
399 included. Contrary to other file inclusion means, the file is not
400 searched with kpathsea(3). I<You are not supposed to use this special
401 and we won't fix any problems with it.>
402
403 =back
404
405 It should be noted that the special parser does sometimes accept
406 constructs that are not valid as in the documentation above. Then, the
407 output is most often damaged in some way.
408
409
410 =head2 Searching for Included Files
411
412 Proper file include specials search the file with kpathsea(3). The
413 search path is configured by variable C<DVILJINPUTS> and, if the file
414 is not found in that search path, by variable C<TEXINPUTS>.
415
416 Search via C<DVILJINPUTS> covers the use case that one has common
417 site-wide graphics that shall be included in documents, e.g., scanned
418 signatures. Search via C<TEXINPUTS> covers the use case that one has
419 graphics as part of ones current document.
420
421 C<dvilj> is used as the C<.PROGRAM> name in F<texmf.cnf>, for all
422 driver variants, independent of the actual program name.
423
424
425 =head2 Unknown Specials and C<TEX_HUSH> configuration
426
427 Kpathsea(3) has the concept of warning suppression with the
428 configuration variable C<TEX_HUSH>, please refer to its Info node
429 I<TeX support / Suppressing warnings>. That variable holds a
430 colon-separated identifiers that specifies the to-be-suppressed
431 warnings.
432
433 If C<special> is among the listed values, B<dvilj> does not output
434 warnings any more about specials that it doesn't know about. But if
435 there is a recognized special and if that special has an invalid
436 parameter, then a warning is output nevertheless, independent of the
437 content of C<TEX_HUSH>.
438
439
440 =head1 DOUBLE PAGE PRINTING
441
442 If the printer has a duplex unit installed, duplex printing can be
443 demanded with the B<-d> option.
444
445 Otherwise, the command line option B<-D> causes the printer to print
446 in doublepage mode, that is, roughly speaking, printing first the even
447 pages and then the odd pages of a document. If B<-D> is used to print
448 both even and odd pages (B<-D> is used without the optional 1 or 2)
449 the following will happen after half of the pages is printed: LJ: the
450 printer stops, shows message "FEED" and switches on manual feed led.
451 The printer continues when either the printed pages are fed into the
452 manual page feeder, or the operator pushes the continue button (after
453 placing first the printed pages into the paper tray).
454
455 If B<-D1> was specified only odd pages will be printed, B<-D2> can be
456 used for even pages. A trailing C<-> (as in B<-D->, B<-D1-> or
457 B<-D2->) suppresses printing of empty pages which are generated for
458 padding otherwise.
459
460 The driver allows the B<-D> option for both print-directions
461 (front-to-back or back-to-front printing). It tries to be clever in
462 certain cases: when a document has an odd number of pages it inserts
463 in the right place an empty page when a document starts with page 0
464 the driver inserts an empty page after the 0-page when a piece of a
465 document is printed that starts with an even page-number it prints
466 this page at the backside of the first page to ensure that the odd
467 sides are always on the frontside. The 0-page is treated like an odd
468 page.
469
470 The doubleside option works for all LJs, not only for the new D model
471 with does doubleside-printing (actually, I don't know whether it makes
472 much sense on the new LJ II D at all).
473
474 Caveat on the doubleside-option: When it is used frequently or on very
475 large files, it might become necessary to clean the printer much more
476 frequently.
477
478 The command line option B<-p>I<X> can be used to abort printing after
479 the output of I<X> pages (can lead to strange results together with
480 B<-D>). I personally dislike this option. The secure way of printing a
481 part of a document is using B<-f> (from) and B<-t> (to).
482
483 =head1 ENVIRONMENT
484
485 B<dvilj> uses the same environment variables and algorithms for finding
486 font files as TeX and its friends do. See the documentation for the
487 kpathsea(3) library for details. (Repeating it here is too cumbersome.)
488
489 =over
490
491 =item C<DVILJFONTS>
492
493 If set, overrides all other font paths.
494
495 =item C<DVILJMAKEPK>
496
497 If set, overrides mktexpk(1) as the name of the command to execute to
498 create a PK file if one isn't found.
499
500 =item C<DVILJSIZES>
501
502 May be set to indicate which sizes of fonts are available. It should
503 consist of a list of numbers separated by colons. If the list begins
504 with a colon, the system default sizes are used, as well. Sizes are
505 expressed in dots per inch; decimals may be used for C<pxl> files: for
506 example, a 300 dots per inch file magnified by half a step comes out
507 to 1643 dots per five inches, which should be encoded as 328.6.
508 B<dvilj> tries the actual size of the font before trying any of the
509 given sizes.
510
511 =item C<DVILJINPUTS>
512
513 Primary search path for include files.
514
515 =item C<TEXINPUTS>
516
517 Secondary search path for include files.
518
519 =item C<TEX_HUSH>
520
521 Colon separated list of identifiers that name situations where no
522 warning shall be output. The following identifiers are used:
523
524 checksum suppress mismatched font checksum warnings
525 readable suppress warnings about unreadable files
526 special suppress warnings about unknown specials
527 all suppress all warning classes above
528 none suppress no warnings
529
530 =item C<KPATHSEA_DEBUG>
531
532 Trace kpathsea(3) lookups; set to -1 for complete tracing.
533
534 =item C<GS_PATH>
535
536 On Windows, this may be the path to Ghostscript; there the default is
537 F<gswin32c.exe>.
538
539 On Unix, this environment variable is not used. Ghostscript is called
540 as gs(1) and must be found over $PATH.
541
542 =back
543
544
545 =head1 SEE ALSO
546
547 dvihp(1), dvicopy(1), dvips(1), xdvi(1), mktexpk(1), gs(1),
548 kpathsea(3)
549
550 Email bug reports to [email protected].
551
552 Source is at L<http://mirror.ctan.org/dviware/dviljk/>; but for
553 compilation the texk build environment is needed, from
554 L<svn://tug.org/texlive/*/Build/source>.
555
556 As of July 2007, PCL reference documentation is found at HP's Web site
557 at
558 L<http://h20000.www2.hp.com/bizsupport/TechSupport/Document.jsp?objectID=bpl04568>.
559 At the end of that page are links to reference manuals for PCL and PJL.
560
561 In case that page is changed, here are the URLs of these documents.
562 All have the form
563 L<http://h20000.www2.hp.com/bc/docs/support/SupportManual/bplE<lt>IDE<gt>/bplE<lt>IDE<gt>.pdf>,
564 where C<E<lt>IDE<gt>> is the following document ID:
565
566 =over
567
568 =item B<13205>
569
570 PCL 5 Technical Quick Reference Guide. This is the 1st thing to look up
571 if you have questions about PCL escape sequences.
572
573 =item B<13210> and B<13211>
574
575 PCL 5 Technical Reference Manual (part I and II). This is the
576 fully detailed explanation that you need to look up if you don't
577 understand how the printer works. Part I is the actual manual, part II
578 explains HP-GL/2 and has overall tips.
579
580 =item B<13208> and B<13207>
581
582 PJL Technical Reference Manual (and addendum)
583
584 =item B<13212>
585
586 PCL 5 Color Manual. This explains color specials for the newer HP
587 printers. (Not of much use today; for practical purposes we would need
588 to add color specials to B<dvilj> first.)
589
590 =item B<13206> and B<13209>
591
592 Comparison Guide (and addendum) that documents which PCL escape
593 sequences are supported on which HP printers.
594
595 =back
596
597 =head1 AUTHOR
598
599 dvi2xx by Gustaf Neumann, Wirtschaftsuniversitaet Wien.
600
601 dviljk fork by Karl Berry.
602
603 Joachim Schrod <[email protected]> supplied security fixes and updated
604 this man page.
605
606 dviljk is currently maintained as part of TeX Live.
607
608 =head1 LICENSE
609
610 dvi2xx is public domain software. dviljk changes are covered by the
611 GNU General Public License.