2 .\" GNU enscript manual page.
3 .\" Copyright (c) 1995-1999 Markku Rossi.
4 .\" Author: Markku Rossi <mtr@iki.fi>
7 .\" This file is part of GNU Enscript.
9 .\" Enscript is free software: you can redistribute it and/or modify
10 .\" it under the terms of the GNU General Public License as published by
11 .\" the Free Software Foundation, either version 3 of the License, or
12 .\" (at your option) any later version.
14 .\" Enscript is distributed in the hope that it will be useful,
15 .\" but WITHOUT ANY WARRANTY; without even the implied warranty of
16 .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 .\" GNU General Public License for more details.
19 .\" You should have received a copy of the GNU General Public License
20 .\" along with Enscript. If not, see <http://www.gnu.org/licenses/>.
22 .TH ENSCRIPT 1 "Mar 12, 1999" "ENSCRIPT" "ENSCRIPT"
25 enscript \- convert text files to PostScript, HTML, RTF, ANSI, and
30 [\f3\-123456789BcgGhjkKlmOqrRvVzZ\f1]
35 [\f3\-C\f1[\f2start_line\f1]]
36 [\f3\-d \f2printer\f1]
37 [\f3\-D \f2key\f1[\f3:\f2value\f1]]
38 [\f3\-e\f1[\f2char\f1]]
39 [\f3\-E\f1[\f2lang\f1]]
41 [\f3\-F \f2header_font\f1]
42 [\f3\-H\f1[\f2num\f1]]
46 [\f3\-L \f2lines_per_page\f1]
49 [\f3\-N \f2newline\f1]
50 [\f3\-o \f2outputfile\f1]
52 [\f3\-p \f2outputfile\f1]
54 [\f3\-P \f2printer\f1]
55 [\f3\-s \f2baselineskip\f1]
56 [\f3\-S \f2key\f1[\f3:\f2value\f1]]
58 [\f3\-T \f2tabsize\f1]
59 [\f3\-u\f1[\f2text\f1]]
61 [\f3\-w \f2language\f1]
62 [\f3\-X \f2encoding\f1]
67 \f3Enscript\f1 converts text files to PostScript or to other output
68 languages. \f3Enscript\f1 can spool the generated output directly to
69 a specified printer or leave it to a file. If no input files are
70 given, \f3enscript\f1 processes the standard input \f3stdin\f1.
71 \f3Enscript\f1 can be extended to handle different output media and it
72 has many options which can be used to customize the printouts.
77 Print \f2num\f1 copies of each page.
79 .B \-1, \-2, \-3, \-4, \-5, \-6, \-7, \-8, \-9, \-\-columns=\f2num\f3
80 Specify how many columns each page have. With the long option
81 \f3\-\-columns=\f2num\f1 you can specify more than 9 columns per page.
83 .B \-a \f2pages\f3, \-\-pages=\f2pages\f3
84 Specify which pages are printed. The page specification \f2pages\f1
85 can be given in the following formats:
88 \f2begin\f1\-\f2end\f1
89 print pages from \f2begin\f1 to \f2end\f1
92 print pages from 0 to \f2end\f1
95 print pages from \f2begin\f1 to end
107 .B \-A \f2align\f3, \-\-file\-align=\f2align\f3
108 Align separate input files to even \f2align\f1 page count. This
109 option is useful in two-side and 2-up printings (\-\-file\-align=2).
111 .B \-b \f2header\f3, \-\-header=\f2header\f3
112 Use the text \f2header\f1 as a page header. The default page header
113 is constructed from the name of the file and from its last
116 The header string \f2header\f1 can contain the same formatting escapes
117 which can be specified for the \f3%Format\f1 directives in the user
118 defined fancy headers. For example, the following option prints the
119 file name, current date and page numbers:
121 \f3enscript \-\-header='$n %W Page $% of $=' *.c\f1
123 The header string can also contain left, center and right justified
124 fields. The fields are separated by the \f3'|'\f1 character:
126 \f3enscript \-\-header='$n|%W|Page $% of $=' *.c\f1
128 now the file name is printed left justified, the date is centered to
129 the header and the page numbers are printed right justified.
131 .B \-B, \-\-no\-header
132 Do not print page headers.
134 .B \-c, \-\-truncate\-lines
135 Cut lines that are too long for the page. As a default,
136 \f3enscript\f1 wraps long lines to the next line so no information is
139 You can also use the \f3\-\-slice\f1 option which slices long lines to
142 .B \-C\f1[\f2start_line\f1]\f3, \-\-line\-numbers\f1[\f3=\f2start_line\f1]\f3
143 Precede each line with its line number. The optional argument
144 \f2start_line\f1 specifies the number of the first line in the input.
145 The number of the first line defaults to 1.
148 Spool output to the printer \f2name\f1.
150 .B \-D \f2key\f1[\f3:\f2value\f1]\f3, \-\-setpagedevice=\f2key\f1[\f3:\f2value\f1]\f3
151 Pass a page device definition to the generated PostScript output. If
152 no value is given, the key \f2key\f1 is removed from the definitions.
154 For example, the command
156 .B enscript \-DDuplex:true foo.txt
158 prints file foo.txt in duplex (two side) mode.
160 Page device operators are implementation dependent but they are
161 standardized. See section \f3PAGE DEVICE OPTIONS\f1 for the details.
163 .B \-e\f1[\f2char\f1]\f3, \-\-escapes\f1[\f3=\f2char\f1]\f3
164 Enable special escapes interpretation (see section \f3SPECIAL
165 ESCAPES\f1). If the argument \f2char\f1 is given, it changes the
166 escape character to \f2char\f1. The default escape character is 0.
168 .B \-E\f1[\f2lang\f1]\f3, \-\-highlight\f1[\f3=\f2lang\f1]\f3
169 Highlight source code by creating a special input filter with the
170 \f3states\f1 program. The optional argument \f2lang\f1 specifies the
171 language to highlight. As a default the \f3states\f1 makes an
174 You can print a short description of the supported highlighting
175 languages and file formats with the command:
177 .B enscript \-\-help\-highlight
179 The highlighting rules are defined in the
180 `@DATADIR@/enscript/hl/*.st' files which can be edited to create
181 highlighting definitions for new languages.
183 \f3Note!\f1 You can not use your own input filters with this option.
185 .B \-f \f2name\f3, \-\-font=\f2name\f3
186 Select a font that is used for the body text. The default body font is
187 \f3Courier10\f1, unless multicolumn landscape printing mode is
188 selected, in which case the default font is \f3Courier7\f1.
190 The font specification \f2name\f1 contains two parts: the name of the
191 font and its size in PostScript points. For example,
192 "\f3Times\-Roman12\f1" selects the "Times\-Roman" font with size
195 The name of the font must appear in @DATADIR@/enscript/font.map and
196 have a corresponding AFM file. See section \f3USING NEW FONTS\f1 for
197 information on adding a font beyond the defaults.
199 The font specification \f2name\f1 can also be given in format
200 `\f2name\f1@\f2ptsize\f1', where the name of the font and its point
201 size are separated by a `@' character. This allows \f3enscript\f1 to use
202 fonts which contain digit characters in their names.
204 The font point size can also be given in the format
205 \f2width\f1/\f2height\f1 where the \f2width\f1 and the \f2height\f1
206 specify the size of the font in x- and y-directions. For example,
207 "\f3Times\-Roman@10/12\f1" selects a 10 points wide and 12 points high
210 You can also give the font sizes as decimal numbers. For example,
211 "\f3Times\-Roman10.2\f1" selects a 10.2pt "Times\-Roman" font.
213 .B \-F \f2name\f3, \-\-header\-font=\f2name\f3
214 Select a font for the header texts.
216 .B \-g, \-\-print\-anyway
217 Print a file even if it contains binary data. The option is
218 implemented only for compatibility purposes. \f3Enscript\f1 prints
219 binary files anyway regardless of the option.
221 .B \-G, \-\-fancy\-header\f1[\f3=\f2name\f1]\f3
222 Print a fancy page header \f2name\f1 to the top of each page. The
223 option \f3\-G\f1 specifies the default fancy header. See section
224 \f3CONFIGURATION FILES\f1 to see how the default fancy header can be
227 .B \-h, \-\-no\-job\-header
228 Suppress printing of the job header page.
230 .B \-H\f1[\f2num\f1]\f3, \-\-highlight\-bars\f1[\f3=\f2num\f1]\f3
231 Specify how high the highlight bars are in lines. If the \f2num\f1 is
232 not given, the default value 2 is used. As a default, no highlight bars
235 .B \-i \f2num\f3, \-\-indent=\f2num\f3
236 Indent every line \f2num\f1 characters. The indentation can also be
237 specified in other units by appending an unit specifier after the
238 number. The possible unit specifiers and the corresponding units are:
254 .B \-I \f2filter\f3, \-\-filter=\f2filter\f1
255 Read all input files through an input filter \f2filter\f1. The input
256 filter can be a single command or a command pipeline. The filter can
257 refer to the name of the input file with the escape `\f3%s\f1'. The
258 name of the standard input can be changed with the option
259 `\f3\-\-filter\-stdin\f1'.
261 For example, the following command prints the file `foo.c' by using
262 only upper-case characters:
264 .B enscript \-\-filter="cat %s | tr 'a-z' 'A-Z'" foo.c
266 The following command highlights changes which are made to files since
269 .B enscript \-\-filter="rcsdiff %s | diffpp %s" \-e *.c
271 To include the string "%s" to the filter command, you must write it as
275 Print borders around columns.
278 An alias for the option \f3\-t\f1, \f3\-\-title\f1.
280 .B \-k, \-\-page\-prefeed
283 .B \-K, \-\-no\-page\-prefeed
284 Disable page prefeed (default).
286 .B \-l, \-\-lineprinter
287 Emulate lineprinter. This option is a shortcut for the options
288 \f3\-\-lines\-per\-page=66\f1, and \f3\-\-no\-header\f1.
290 .B \-L \f2num\f3, \-\-lines\-per\-page=\f2num\f3
291 Print only \f2num\f1 lines for each page. As a default, the number of
292 lines per page is computed from the height of the page and from the
296 Send a mail notification to user after the print job has been
299 .B \-M \f2name\f3, \-\-media=\f2name\f3
300 Select an output media \f2name\f1. \f3Enscript\f1's default output
301 media is \f3@media@\f1.
303 .B \-n \f2num\f3, \-\-copies=\f2num\f3
304 Print \f2num\f1 copies of each page.
306 .B \-N \f2nl\f3, \-\-newline=\f2nl\f3
307 Select the \f2newline\f1 character. The possible values for \f2nl\f1
308 are: \f3n\f1 (unix newline, 0xa hex) and \f3r\f1 (mac newline, 0xd hex).
311 An alias for the option \f3\-p\f1, \f3\-\-output\f1.
313 .B \-O, \-\-missing\-characters
314 Print a listing of character codes which couldn't be printed.
316 .B \-p \f2file\f3, \-\-output=\f2file\f3
317 Leave the output to file \f2file\f1. If the \f2file\f1 is `\-',
318 enscript sends the output to the standard output \f3stdout\f1.
320 .B \-P \f2name\f3, \-\-printer=\f2name\f3
321 Spool the output to the printer \f2name\f1.
323 .B \-q, \-\-quiet, \-\-silent
324 Make \f3enscript\f1 really quiet. Only fatal error messages are
325 printed to \f2stderr\f1.
327 .B \-r, \-\-landscape
328 Print in the landscape mode; rotate page 90 degrees.
331 Print in the portrait mode (default).
333 .B \-s \f2num\f3, \-\-baselineskip=\f2num\f3
334 Specify the baseline skip in PostScript points. The number \f2num\f1
335 can be given as a decimal number. When \f3enscript\f1 moves from line
336 to line, the current point \f2y\f1 coordinate is moved (\f2font point
337 size + baselineskip\f1) points down. The default baseline skip is 1.
339 .B \-S \f2key\f1[\f3:\f2value\f1]\f3, \-\-statusdict=\f2key\f1[\f3:\f2value\f1]\f3
340 Pass a statusdict definition to the generated PostScript output. If
341 no value is given, the key \f2key\f1 is removed from the definitions.
343 The statusdict operators are implementation dependent; see the
344 printer's documentation for the details.
346 For example, the command
348 .B enscript \-Ssetpapertray:1 foo.txt
350 prints the file \f2foo.txt\f1 by using paper from the paper tray 1
351 (assuming that the printer supports paper tray selection).
353 .B \-t \f2title\f3, \-\-title=\f2title\f3
354 Set banner page's job title to \f2title\f1. The option sets also the
355 name of the input file \f3stdin\f1.
357 .B \-T \f2num\f3, \-\-tabsize=\f2num\f3
358 Set the tabulator size to \f2num\f1 characters. The default is 8.
360 .B \-u\f1[\f2text\f1]\f3, \-\-underlay\f1[\f3=\f2text\f1]\f3
361 Print the string \f2text\f1 under every page. The properties of the
362 text can be changed with the options \f3\-\-ul\-angle\f1,
363 \f3\-\-ul\-font\f1, \f3\-\-ul\-gray\f1, \f3\-\-ul\-position\f1, and
366 If no \f2text\f1 is given, the underlay is not printed. This can be used
367 to remove an underlay text that was specified with the
368 `\f3Underlay\f1' configuration file option.
370 .B \-U \f2num\f3, \-\-nup=\f2num\f3
371 Print \f2num\f1 logical pages on each output page (N\-up printing).
372 The values \f2num\f1 must be a power of 2.
374 .B \-v, \-\-verbose\f1[\f3=\f2level\f1]\f3
375 Tell what \f3enscript\f1 is doing.
378 Print \f3enscript\f1 version information and exit.
380 .B \-w \f1[\f2lang\f1]\f3, \-\-language\f1[\f3=\f2lang\f1]\f3
381 Generate output for the language \f2lang\f1. The possible values for
386 generate PostScript (default)
392 generate overstrikes (line printers, less)
395 generate RTF (Rich Text Format)
398 generate ANSI terminal control codes
401 .B \-W \f2app\f1,\f2option\f3, \-\-language\f3=\f2app\f1,\f2option\f3
402 pass the option \f2option\f3 to helper application \f2app\f3.
404 .B \-X \f2name\f3, \-\-encoding=\f2name\f3
405 Use the input encoding \f2name\f1. Currently \f3enscript\f1 supports
406 the following encodings:
410 ISO\-8859\-1 (ISO Latin1) (\f3enscript\f1's default encoding).
413 ISO\-8859\-2 (ISO Latin2)
416 ISO\-8859\-3 (ISO Latin3)
419 ISO\-8859\-4 (ISO Latin4)
422 ISO\-8859\-5 (ISO Cyrillic)
425 ISO\-8859\-7 (ISO Greek)
428 ISO\-8859\-9 (ISO Latin5)
431 ISO\-8859\-10 (ISO Latin6)
434 ISO\-8859\-15 (ISO Latin9)
439 .B asciifise, asciifi, asciise
440 7\-bit ascii with some scandinavian (Finland, Sweden) extensions
442 .B asciidkno, asciidk, asciino
443 7\-bit ascii with some scandinavian (Denmark, Norway) extensions
452 VMS multinational charset
458 Adobe Standard Cyrillic Font KOI8 charset
461 PostScript font's default encoding
463 .B pslatin1, ISOLatin1Encoding
464 PostScript interpreter's `ISOLatin1Encoding'
467 .B \-z, \-\-no\-formfeed
468 Turn off the form feed character interpretation.
470 .B \-Z, \-\-pass\-through
471 Pass through all PostScript and PCL files without any modifications.
472 This allows that \f3enscript\f1 can be used as a lp filter.
474 The PostScript files are recognized by looking up the `%!' magic
475 cookie from the beginning of the file. \f3Note!\f1 \f3Enscript\f1
476 recognized also the Windoze damaged `^D%!' cookie.
478 The PCL files are recognized by looking up the `^[E' or `^[%' magic
479 cookies from the beginning of the file.
481 .B \-\-color\f1[\f3=\f2bool\f1]\f3
482 Use colors in the highlighting outputs.
484 .B \-\-download\-font=\f2fontname\f3
485 Include the font description file (\f2.pfa\f1 or \f2.pfb\f1 file) of
486 the font \f2fontname\f1 to the generated output.
488 .B \-\-extended\-return\-values
489 Enable extended return values. As a default, \f3enscript\f1 returns 1
490 on error and 0 otherwise. The extended return values give more
491 details about the printing operation. See the section \f3RETURN
492 VALUE\f1 for the details.
494 .B \-\-filter\-stdin=\f2name\f1
495 Specify how the \f3stdin\f1 is shown to the input filter. The default
496 value is an empty string ("") but some programs require that the
497 \f3stdin\f1 is called something else, usually "-".
499 .B \-\-footer=\f2footer\f3
500 Use the text \f2footer\f1 as a page footer. Otherwise the option
501 works like the \f3\-\-header\f1 option. As a default, the page has no footer.
502 Setting this option does not necessary shows any footer strings in the output.
503 It depends on the selected fancy header ('.hdr' file) whether it supports footer strings or not.
505 .B \-\-h\-column\-height=\f2height\f3
506 Set the horizontal column height to be \f2height\f1 PostScript
507 points. The option sets the formfeed type to
508 \f3horizontal\-columns\f1.
511 Print a short help message and exit.
513 .B \-\-help\-highlight
514 Describe all supported \f3\-\-highlight\f1 languages and file
517 .B \-\-highlight\-bar\-gray=\f2gray\f3
518 Specify the gray level which is used in printing the highlight bars.
521 List the names of all known output media and exit successfully.
523 .B \-\-margins=\f2left\f3:\f2right\f3:\f2top\f3:\f2bottom\f3
524 Adjust the page marginals to be exactly \f2left\f1, \f2right\f1, \f2top\f1
525 and \f2bottom\f1 PostScript points. Any of the arguments can be left
526 empty in which case the default value is used.
528 .B \-\-mark\-wrapped\-lines\f1[\f3=\f2style\f1]\f3
529 Mark wrapped lines in the output with the style \f2style\f1. The
530 possible values for the \f2style\f1 are:
534 do not mark them (default)
537 print a plus (+) character to the end of each wrapped line
540 print a black box to the end of each wrapped line
543 print a small arrow to the end of each wrapped line
546 .B \-\-non\-printable\-format=\f2format\f3
547 Specify how the non-printable characters are printed. The possible
548 values for the \f2format\f1 are:
552 caret notation: `^@', `^A', `^B', ...
555 octal notation: `\\000', `\\001', `\\002', ... (default)
558 replace non-printable characters with a question mark `?'
561 replace non-printable characters with a space ` '
564 .B \-\-nup\-columnwise
565 Change the layout of the sub-pages in the N\-up printing from row-wise
568 .B \-\-nup\-xpad=\f2num\f3
569 Set the page x-padding of the \f2n\f1-up printing to \f2num\f1
570 PostScript points. The default is 10 points.
572 .B \-\-nup\-ypad=\f2num\f3
573 Set the page y-padding of the \f2n\f1-up printing to \f2num\f1
574 PostScript points. The default is 10 points.
576 .B \-\-page\-label\-format=\f2format\f3
577 Set the page label format to \f2format\f1. The page label format
578 specifies how the labels for the `%%Page:' PostScript comments are
579 formatted. The possible values are:
583 Print the current pagenumber: `%%Page: (1) 1' (default)
586 Print the current filename and pagenumber: `%%Page: (main.c: 1) 1'
589 .B \-\-ps\-level=\f2level\f3
590 Set the PostScript language level that \f3enscript\f1 uses for its
591 output to \f2level\f1. The possible values are \f31\f1, and
594 .B \-\-printer\-options=\f2options\f3
595 Pass extra options to the printer command.
597 .B \-\-rotate\-even\-pages
598 Rotate each even\-numbered page 180 degrees.
600 .B \-\-slice=\f2num\f3
601 Print the vertical slice \f2num\f1. The slices are vertical regions
602 of input files. A new slice starts from the point where the line
603 would otherwise be wrapped to the next line. The slice numbers start
606 .B \-\-style=\f2style\f3
607 Set the highlighting style to \f2style\f1. The possible values are:
608 \f3a2ps\f1, \f3emacs\f1, \f3emacs_verbose\f1, \f3ifh\f1, and
611 .B \-\-swap\-even\-page\-margins
612 Swap left and right page margins for even\-numbered pages.
615 Print a table of contents to the end of the output.
618 Wrap long lines from word boundaries.
620 .B \-\-ul\-angle=\f2angle\f3
621 Set the angle of the underlay text to \f2angle\f1. As a default,
622 the angle is \f3atan(\-d_page_h, d_page_w)\f1.
624 .B \-\-ul\-font=\f2name\f3
625 Select a font for the underlay text. The default underlay font is
626 \f3Times-Roman200\f1.
628 .B \-\-ul\-gray=\f2num\f3
629 Print the underlay text with the gray value \f2num\f1 (0 ... 1), the
630 default gray value is .8.
632 .B \-\-ul\-position=\f2position_spec\f3
633 Set the underlay text's starting position according to the
634 \f2position_spec\f1. The position specification must be given in
635 format: `\f2sign\f1 \f2xpos\f1 \f2sign\f1 \f2ypos\f1', where the
636 \f2sign\f1 must be `+' or `\-'. The positive dimensions are measured
637 from the lower left corner and the negative dimensions from the upper
638 right corner. For example, the specification `+0\-0' specifies the
639 upper left corner and `\-0+0' specifies the lower right corner.
641 .B \-\-ul\-style=\f2style\f3
642 Set the underlay text's style to \f2style\f1. The possible values for
647 print outline underlay texts (default)
650 print filled underlay texts
653 .SH CONFIGURATION FILES
656 reads configuration information from the following sources (in this
657 order): command line options, environment variable \f3ENSCRIPT\f1,
658 user's personal configuration file (\f3$HOME/.enscriptrc\f1), site
659 configuration file (\f3@SYSCONFDIR@/enscriptsite.cfg\f1) and system's
660 global configuration file (\f3@SYSCONFDIR@/enscript.cfg\f1).
662 The configuration files have the following format:
664 Empty lines and lines starting with `#' are comments.
666 All other lines are option lines and have format:
668 \f2option\f1 [\f2arguments ...\f1].
670 The following options can be specified:
672 .B AcceptCompositeCharacters: \f2bool\f1
673 Specify whether PostScript font's composite characters are accepted
674 as printable or if they should be considered as non-existent. The
675 default value is false (0).
677 .B AFMPath: \f2path\f3
678 Specifies the search path for the \f2AFM\f1 files.
680 .B AppendCtrlD: \f2bool\f3
681 Specify if the Control-D (^D) character should be appended to the end
682 of the output. The default value is false (0).
684 .B Clean7Bit: \f2bool\f3
685 Specify how characters greater than 127 are printed. The valuee true
686 (1) generates 7-bit clean code by escaping all characters greater than
687 127 to the backslash-octal notation (default). The value false (0)
688 generates 8-bit PostScript code leaving all characters untouched.
690 .B DefaultEncoding: \f2name\f3
691 Select the default input encoding. The encoding name \f2name\f1 can
692 be one of the values of the option \f3\-X\f1, \f3\-\-encoding\f1.
694 .B DefaultFancyHeader: \f2name\f3
695 Select the default fancy header. The default header is used when the
696 option \f3\-G\f1 is specified or the option \f3\-\-fancy\-header\f1 is
697 given without an argument. The system\-wide default is `\f3enscript\f1'.
699 .B DefaultMedia: \f2name\f3
700 Select the default output media.
702 .B DefaultOutputMethod: \f2method\f3
703 Select the default target to which the generated output is sent.
704 The possible values for the \f2method\f1 are:
708 send output to printer (default)
711 send output to \f3stdout\f1
714 .B DownloadFont: \f2fontname\f3
715 Include the font description file of the font \f2fontname\f1 to the
718 .B EscapeChar: \f2num\f3
719 Specify the escape character for the special escapes. The default
722 .B FormFeedType: \f2type\f3
723 Specify what to do when a formfeed character is encountered from the
724 input. The possible values for \f2type\f1 are:
728 move to the beginning of the next column (default)
731 move to the beginning of the next page
734 .B GeneratePageSize: \f2bool\f3
735 Specify whether the \f3PageSize\f1 page device setting is generated to
736 the PostScript output. The default value is true (1).
738 .B HighlightBarGray: \f2gray\f3
739 Specify the gray level which is used to print the highlight bars.
741 .B HighlightBars: \f2num\f3
742 Specify how high the highlight bars are in lines. The default value
743 is 0 which means that no highlight bars are printed.
745 .B LibraryPath: \f2path\f3
746 Specifies the \f3enscript\f1's library path that is used to lookup
747 various resources. The default path is:
748 `@DATADIR@/enscript:\f2home\f1/.enscript'. Where the \f2home\f1 is
749 the user's home directory.
751 .B MarkWrappedLines: \f2style\f3
752 Mark wrapped lines in the output with the style \f2style\f1. The
753 possible values for the \f2format\f1 are the same which can be given
754 for the \f3\-\-mark\-wrapped\-lines\f1 option.
756 \f3Media: \f2name\f3 \f2width\f3 \f2height\f3 \f2llx\f3 \f2lly\f3 \f2urx\f3 \f2ury\f3
757 Add a new output media with the name \f2name\f1. The physical
758 dimensions of the media are \f2width\f1 and \f2height\f1. The
759 bounding box of the Media is specified by the points (\f2llx\f1,
760 \f2lly\f1) and (\f2urx\f1, \f2ury\f1). \f3Enscript\f1 prints all
761 graphics inside the bounding box of the media.
763 User can select this media with option \f3\-M \f2name\f1.
765 .B NoJobHeaderSwitch: \f2switch\f1
766 Specify the spooler option to suppress the print job header page.
767 This option is passed to the printer spooler when the \f3enscript\f1's
768 option \f3\-h\f1, \f3\-\-no\-job\-header\f1 is selected.
770 .B NonPrintableFormat: \f2format\f1
771 Specify how the non-printable characters are printed. The possible
772 values for \f2format\f1 are the same which can be given for the
773 \f3\-\-non\-printable\-format\f1 option.
775 .B OutputFirstLine: \f2line\f1
776 Set the PostScript output's first line to \f2line\f1. The default
777 value is \f3PS-Adobe-3.0\f1. Since some printers do not like DSC
778 levels greater than 2.0, this option can be used to change the output
779 first line to something more suitable like \f3%!PS-Adobe-2.0\f1 or
782 .B PageLabelFormat: \f2format\f1
783 Set the page label format to \f2format\f1. The possible values for
784 \f2format\f1 are the same which can be given for the
785 \f3\-\-page\-label\-format\f1 option.
787 .B PagePrefeed: \f2bool\f3
788 Enable / disable page prefeed. The default value is false (0).
790 .B PostScriptLevel: \f2level\f3
791 Set the PostScript language level, that \f3enscript\f1 uses for its
792 output, to \f2level\f1. The possible values for \f2level\f1 are the
793 same which can be given for the \f3\-\-ps\-level\f1 option.
795 .B Printer: \f2name\f3
796 Names the printer to which the output is spooled.
798 .B QueueParam: \f2name\f3
799 The spooler command switch to select the printer queue, e.g. \f3\-P\f1
800 in \f3lpr \-Pps\f1. This option can also be used to pass other flags
801 to the spooler command. These options must be given before the queue
804 .B SetPageDevice: \f2key\f1[\f3:\f2value\f1]\f3
805 Pass a page device definition to the generated PostScript output.
807 .B Spooler: \f2name\f3
808 Names the printer spooler command. \f3Enscript\f1 pipes generated
809 PostScript to the command \f2name\f1.
811 .B StatesBinary: \f2path\f3
812 Define an absolute path to the \f3states\f1 program.
814 .B StatesColor: \f2bool\f3
815 Should the \f3states\f1 program generate color outputs.
817 .B StatesConfigFile: \f2file\f3
818 Read highlighting states configuration from the file \f2file\f1. The
819 default config file is `@DATADIR@/enscript/hl/enscript.st'.
821 .B StatesHighlightStyle: \f2style\f3
822 Set the highlight style to \f2style\f1.
824 .B StatesPath: \f2path\f3
825 Define the path for the \f3states\f1 program. The \f3states\f1
826 program will lookup its state definition files from this path. The
827 default value is `$HOME/.enscript:@DATADIR@/enscript/hl'.
829 .B StatusDict: \f2key\f1[\f3:\f2value\f1]\f3
830 Pass a statusdict definition to the generated PostScript output.
832 .B TOCFormat: \f2format\f3
833 Format table of contents entries with the format string \f2format\f1.
834 The format string \f2format\f1 can contain the same escapes which are
835 used to format header strings with the `%Format' special comment.
837 .B Underlay: \f2text\f3
838 Print string \f2text\f1 under every page.
840 .B UnderlayAngle: \f2num\f3
841 Set the angle of the underlay text to \f2num\f1.
843 .B UnderlayFont: \f2fontspec\f3
844 Select a font for the underlay text.
846 .B UnderlayGray: \f2num\f3
847 Print the underlay text with the gray value \f2num\f1.
849 .B UnderlayPosition: \f2position_spec\f3
850 Set the underlay text's starting position according to the
853 .B UnderlayStyle: \f2style\f3
854 Set the underlay text's style to \f2style\f1.
858 Users can create their own fancy headers by creating a header
859 description file and placing it in a directory which is in
860 \f3enscript\f1's library path. The name of the header file must be in
861 format: `\f2headername\f1.hdr'. Header can be selected by giving
862 option: \f3\-\-fancy\-header=\f2headername\f1.
864 Header description file contains PostScript code that paints the
865 header. Description file must provide procedure \f3do_header\f1 which
866 is called by \f3enscript\f1 at the beginning of every page.
868 Header description file contains two parts: comments and code. Parts
869 are separated by a line containing text:
871 % \-\- code follows this line \-\-
874 copies only the code part of description file to the generated
875 PostScript output. The comments part can contain any data, it is not
876 copied. If separator line is missing, no data is copied to output.
879 defines following constants which can be used in header description
889 header lower left \f2x\f1 coordinate
892 header lower left \f2y\f1 coordinate
901 footer lower left \f2x\f1 coordinate
904 footer lower left \f2y\f1 coordinate
913 width of the text output area
916 height of the text output area
919 predicate which tells if user has defined his/her own header string:
920 \f3true\f1/\f3false\f1
922 .B user_header_left_str
923 if \f3user_header_p\f1 is \f3true\f1, this is the left field of the
924 user supplied header string.
926 .B user_header_center_str
927 if \f3user_header_p\f1 is \f3true\f1, this is the center field of the
928 user supplied header string
930 .B user_header_right_str
931 if \f3user_header_p\f1 is \f3true\f1, this is the right field of the
932 user supplied header string
935 predicate which tells if user has defined his/her own footer string:
936 \f3true\f1/\f3false\f1
938 .B user_footer_left_str
939 if \f3user_footer_p\f1 is \f3true\f1, this is the left field of the
940 user supplied footer string.
942 .B user_footer_center_str
943 if \f3user_footer_p\f1 is \f3true\f1, this is the center field of the
944 user supplied footer string
946 .B user_footer_right_str
947 if \f3user_footer_p\f1 is \f3true\f1, this is the right field of the
948 user supplied footer string
951 standard header font (from \f3\-F\f1, \f3\-\-header\-font\f1 option).
952 This can be selected simply by invoking command: `\f3HF setfont\f1'.
955 the number of the current page
958 the full name of the printed file (/foo/bar.c)
961 the directory part of the file name (/foo)
964 file name without the directory part (bar.c)
967 PostScript interpreter's language level (currently 1 or 2)
970 You can also use the following special comments to customize your
971 headers and to specify some extra options. Special comments are like
972 DSC comments but they start with a single `%' character; special
973 comments start from the beginning of the line and they have the
976 %\f2commentname\f1: \f2options\f1
978 Currently \f3enscript\f1 support the following special comments:
980 .B %Format: \f2name\f3 \f2format\f3
981 Define a new string constant \f2name\f1 according to the format string
982 \f2format\f1. Format string start from the first non-space character
983 and it ends to the end of the line. Format string can contain general
984 `%' escapes and input file related `$' escapes. Currently following
985 escapes are supported:
998 number of pages in the current file
1001 number of pages processed so far
1004 value of the environment variable \f2VAR\f1.
1007 trailing component of the current working directory
1009 .B %C \f1(\f3$C\f1)\f3
1010 current time (file modification time) in `hh:mm:ss' format
1013 current working directory
1015 .B %D \f1(\f3$D\f1)\f3
1016 current date (file modification date) in `yy-mm-dd' format
1018 .B %D{\f2string\f3} \f1(\f3$D{\f2string\f3}\f1)\f3
1019 format string \f2string\f1 with the strftime(3) function.
1020 `\f3%D{}\f1' refers to the current date and `\f3$D{}\f1' to the input
1021 file's last modification date.
1023 .B %E \f1(\f3$E\f1)\f3
1024 current date (file modification date) in `yy/mm/dd' format
1026 .B %F \f1(\f3$F\f1)\f3
1027 current date (file modification date) in `dd.mm.yyyy' format
1033 number of lines in the current input file. This is valid only for the
1034 toc entries, it can't be used in header strings.
1037 the hostname up to the first `.' character
1046 input file name without the directory part
1049 the user's pw_gecos field up to the first `,' character
1052 the full input file name
1054 .B %t \f1(\f3$t\f1)\f3
1055 current time (file modification time) in 12-hour am/pm format
1057 .B %T \f1(\f3$T\f1)\f3
1058 current time (file modification time) in 24-hour format `hh:mm'
1060 .B %* \f1(\f3$*\f1)\f3
1061 current time (file modification time) in 24-hour format with seconds
1065 the sequence number of the current input file
1068 the sequence number of the current input file in the `Table of
1069 Contents' format: if the \f3\-\-toc\f1 option is given, escape expands
1070 to `\f2num\f1\-'; if the \f3\-\-toc\f1 is not given, escape expands to
1073 .B %W \f1(\f3$W\f1)\f3
1074 current date (file modification date) in `mm/dd/yy' format
1078 All format directives except `$=' can also be given in format
1080 \f2escape\f1 \f2width\f1 \f2directive\f1
1082 where \f2width\f1 specifies the width of the column to which the
1083 escape is printed. For example, escape "$5%" will expand to something
1084 like " 12". If the width is negative, the value will be printed
1087 For example, the `emacs.hdr' defines its date string with the
1088 following format comment:
1090 .B %Format: eurdatestr %E
1094 .B /eurdatestr (96/01/08) def
1098 .B %HeaderHeight: \f2height\f1
1099 Allocate \f2height\f1 points space for the page header. The default
1100 header height is 36 points.
1102 .B %FooterHeight: \f2height\f1
1103 Allocate \f2height\f1 points space for the page footer. The default
1104 footer height is 0 points.
1107 According to Adobe's Document Structuring Conventions (DSC), all
1108 resources needed by a document must be listed in document's prolog.
1109 Since user's can create their own headers, \f3enscript\f1 don't know
1110 what resources those headers use. That's why all headers must contain
1111 a standard DSC comment that lists all needed resources. For example,
1112 used fonts can be listed with following comment:
1114 %%DocumentNeededResources: font \f2fontname1\f1 \f2fontname2\f1
1116 Comment can be continued to the next line with the standard
1117 continuation comment:
1119 %%+ font \f2fontname3\f1
1123 \f3Enscript\f1 supports special escape sequences which can be used to
1124 add some page formatting commands to ASCII documents. As a default,
1125 special escapes interpretation is off, so all ASCII files print out as
1126 everyone expects. Special escapes interpretation is activated by
1127 giving option \f3\-e\f1, \f3\-\-escapes\f1 to \f3enscript\f1.
1129 All special escapes start with the escape character. The default
1130 escape character is ^@ (octal 000); escape character can be changed
1131 with option \f3\-e\f1, \f3\-\-escapes\f1. Escape character is
1132 followed by escape's name and optional options and arguments.
1134 Currently \f3enscript\f1 supports following escapes:
1137 change the text background color. The syntax of the escape is:
1139 ^@bgcolor{\f2red\f1 \f2green\f1 \f2blue\f1}
1141 where the color components \f2red\f1, \f2green\f1, and \f1blue\f1 are
1142 given as decimal numbers between values 0 and 1.
1146 change the text background color. The syntax of the escape is:
1148 ^@bggray{\f2gray\f1}
1150 where \f2gray\f1 is the new text background gray value. The default
1151 value is 1.0 (white).
1154 change the text color. The syntax of the escape is:
1156 ^@color{\f2red\f1 \f2green\f1 \f2blue\f1}
1158 where color components \f2red\f1, \f2green\f1 and \f2blue\f1 are given
1159 as decimal numbers between values 0 and 1.
1162 comment the rest of the line including the newline character.
1165 ^@comment \f2text\f1 \f2newline_character\f1
1168 change the escape character. The syntax of the escape is:
1170 ^@escape{\f2code\f1}
1172 where \f2code\f1 is the decimal code of the new escape character.
1175 inline EPS file to the document. The syntax of the escape is:
1177 ^@epsf[\f2options\f1]{\f2filename\f1}
1179 where \f2options\f1 is an optional sequence of option characters and
1180 values enclosed with brackets and \f2filename\f1 is the name of the
1183 If \f2filename\f1 ends to the `|' character, then \f2filename\f1 is
1184 assumed to name a command that prints EPS data to its standard output.
1185 In this case, \f3enscript\f1 opens a pipe to the specified command
1186 and reads EPS data from pipe.
1188 Following options can be given for the \f3epsf\f1 escape:
1192 print image centered
1195 print image right justified
1198 do not update current point. Following output is printed to that
1199 position where the current point was just before the \f3epsf\f1 escape
1202 do not update current point \f2x\f1 coordinate
1205 do not update current point \f2y\f1 coordinate
1208 move image's top left \f2x\f1 coordinate \f2num\f1 characters from
1209 current point \f2x\f1 coordinate (relative position)
1212 set image's top left \f2x\f1 coordinate to column \f2num\f1 (absolute
1216 move image's top left \f2y\f1 coordinate \f2num\f1 lines from current
1217 line (relative position)
1220 set image's top left \f2y\f1 coordinate to line \f2num\f1 (absolute
1224 set image's height to \f2num\f1 lines
1227 scale image with factor \f2num\f1
1230 scale image in \f2x\f1 direction with factor \f2num\f1
1233 scale image in \f2y\f1 direction with factor \f2num\f1
1235 As a default, all dimensions are given in lines (vertical) and
1236 characters (horizontal). You can also specify other units by
1237 appending an unit specifier after number. Possible unit specifiers
1238 and the corresponding units are:
1247 lines or characters (default)
1252 For example to print an image one inch high, you can specify height by
1253 following options: \f3h1i\f1 (1 inch), \f3h2.54c\f1 (2.54 cm),
1254 \f3h72p\f1 (72 points).
1258 select current font. The syntax of the escape is:
1260 ^@font{\f2fontname\f1[:\f2encoding\f1]}
1262 where \f2fontname\f1 is a standard font specification. Special font
1263 specification \f3default\f1 can be used to select the default body
1264 font (\f3enscript\f1's default or the one specified by the command
1265 line option \f3\-f\f1, \f3\-\-font\f1).
1267 The optional argument \f2encoding\f1 specifies the encoding that
1268 should be used for the new font. Currently the encoding can only be
1269 the \f3enscript\f1's global input encoding or \f3ps\f1.
1272 include raw PostScript code to the output. The syntax of the escape
1278 highlight regions of text by changing the text background color.
1283 where \f2gray\f1 is the new text background gray value. The default
1284 value is 1.0 (white) which disables highlighting.
1286 .SH PAGE DEVICE OPTIONS
1288 Page device is a PostScript level 2 feature that offers an uniform
1289 interface to control printer's output device. \f3Enscript\f1
1290 protects all page device options inside an if block so they have no
1291 effect in level 1 interpreters. Although all level 2 interpreters
1292 support page device, they do not have to support all page device
1293 options. For example some printers can print in duplex mode and some
1294 can not. Refer to the documentation of your printer for supported
1297 Here are some usable page device options which can be selected with
1298 the \f3\-D\f1, \f3\-\-setpagedevice\f1 option. For a complete listing,
1299 see \f2PostScript Language Reference Manual\f1: section 4.11 Device
1302 .B Collate \f2boolean\f1
1303 how output is organized when printing multiple copies
1305 .B Duplex \f2boolean\f1
1306 duplex (two side) printing
1308 .B ManualFeed \f2boolean\f1
1309 manual feed paper tray
1311 .B OutputFaceUp \f2boolean\f1
1312 print output `face up' or `face down'
1314 .B Tumble \f2boolean\f1
1315 how opposite sides are positioned in duplex printing
1317 .SH PRINTING EXAMPLES
1319 Following printing examples assume that \f3enscript\f1 uses the
1320 default configuration. If default actions have been changed from the
1321 configuration files, some examples will behave differently.
1324 Print file \f3foo.txt\f1 to the default printer.
1326 .B enscript \-Possu foo.txt
1327 Print file \f3foo.txt\f1 to printer \f3ossu\f1.
1329 .B enscript \-pfoo.ps foo.txt
1330 Print file \f3foo.txt\f1, but leave PostScript output to file
1333 .B enscript \-2 foo.txt
1334 Print file \f3foo.txt\f1 to two columns.
1336 .B enscript \-2r foo.txt
1337 Print file to two columns and rotate output 90 degrees (landscape).
1339 .B enscript \-DDuplex:true foo.txt
1340 Print file in duplex (two side) mode (printer dependent).
1342 .B enscript \-G2rE \-U2 foo.c
1343 My default code printing command: gaudy header, two columns,
1344 landscape, code highlighting, 2-up printing.
1346 \f3enscript \-E \-\-color \-whtml \-\-toc \-pfoo.html *.h *.c\f1
1347 A nice HTML report of your project's C source files.
1349 .SH ENVIRONMENT VARIABLES
1351 The environment variable \f3ENSCRIPT\f1 can be used to pass default
1352 options for \f3enscript\f1. For example, to select the default body
1353 font to be Times\-Roman 7pt, set the following value to the
1354 \f3ENSCRIPT\f1 environment variable:
1359 The value of the \f3ENSCRIPT\f1 variable is processed before the
1360 command line options, so command line options can be used to overwrite
1363 Variable \f3ENSCRIPT_LIBRARY\f1 specifies the \f3enscript\f1's
1364 library directory. It can be used to overwrite the build-in default
1365 `@DATADIR@/enscript'.
1369 \f3Enscript\f1 returns value 1 to the shell if any errors were
1370 encountered or 0 otherwise. If the option
1371 \f3\-\-extended\-return\-values\f1 was specified, the return value is
1372 constructed from the following flags:
1375 no errors or warnings
1378 some lines were truncated or wrapped
1381 some characters were missing from the used fonts
1384 some characters were unprintable
1390 @DATADIR@/enscript/*.hdr header files
1391 @DATADIR@/enscript/*.enc input encoding vectors
1392 @DATADIR@/enscript/enscript.pro PostScript prolog
1393 @DATADIR@/enscript/afm/*.afm AFM files for PostScript fonts
1394 @DATADIR@/enscript/font.map index for the AFM files
1395 @DATADIR@/enscript/hl/*.st states definition files
1396 @SYSCONFDIR@/enscript.cfg system\-wide configuration file
1397 @SYSCONFDIR@/enscriptsite.cfg site configuration file
1398 ~/.enscriptrc personal configuration file
1399 ~/.enscript/ personal resource directory
1404 If you instruct enscript to use a font whose name does not appear in the
1405 font map, it will give the warning "couldn't open AFM file for font".
1407 To create an AFM file for a TrueType font, you can use \f3ttf2pt1\f1.
1409 Once you create the AFM file, you must add it to the font map.
1411 To generate a new font map automatically, use \f3mkafmmap\f1.
1414 diffpp(1), ghostview(1), gs(1), lpq(1), lpr(1), lprm(1), states(1)
1417 Markku Rossi <mtr@iki.fi> <http://www.iki.fi/~mtr/>
1419 GNU Enscript WWW home page: <http://www.iki.fi/~mtr/genscript/>