1ENSCRIPT(1)                        ENSCRIPT                        ENSCRIPT(1)
2
3
4

NAME

6       enscript - convert text files to PostScript, HTML, RTF, ANSI, and over‐
7       strikes
8
9

SYNOPSIS

11       enscript [-123456789BcgGhjkKlmOqrRvVzZ]  [-#  copies]  [-a  pages]  [-A
12       align]  [-b  header]  [-C[start_line]]  [-d  printer]  [-D key[:value]]
13       [-e[char]] [-E[lang]] [-f font] [-F header_font] [-H[num]] [-i  indent]
14       [-I  filter]  [-J title] [-L lines_per_page] [-M media] [-n copies] [-N
15       newline] [-o outputfile] [-o -] [-p outputfile] [-p -] [-P printer] [-s
16       baselineskip]  [-S  key[:value]] [-t title] [-T tabsize] [-u[text]] [-U
17       num] [-w language] [-X encoding] [filename ...]
18
19

DESCRIPTION

21       Enscript converts text files to PostScript  or  to  other  output  lan‐
22       guages.   Enscript  can spool the generated output directly to a speci‐
23       fied printer or leave it to a file.   If  no  input  files  are  given,
24       enscript  processes the standard input stdin.  Enscript can be extended
25       to handle different output media and it has many options which  can  be
26       used to customize the printouts.
27
28

OPTIONS

30       -# num  Print num copies of each page.
31
32       -1, -2, -3, -4, -5, -6, -7, -8, -9, --columns=num
33               Specify  how many columns each page have.  With the long option
34               --columns=num you can specify more than 9 columns per page.
35
36       -a pages, --pages=pages
37               Specify which pages are printed.  The page specification  pages
38               can be given in the following formats:
39
40               begin-end
41                       print pages from begin to end
42
43               -end    print pages from 0 to end
44
45               begin-  print pages from begin to end
46
47               page    print page page
48
49               odd     print odd pages
50
51               even    print even pages
52
53       -A align, --file-align=align
54               Align  separate  input  files  to  even align page count.  This
55               option   is   useful   in   two-side   and    2-up    printings
56               (--file-align=2).
57
58       -b header, --header=header
59               Use  the text header as a page header.  The default page header
60               is constructed from the name of the file and from its last mod‐
61               ification time.
62
63               The  header  string  header  can  contain  the  same formatting
64               escapes which can be specified for the  %Format  directives  in
65               the  user  defined  fancy  headers.  For example, the following
66               option prints the file name, current date and page numbers:
67
68               enscript --header='$n %W Page $% of $=' *.c
69
70               The header string can also contain left, center and right  jus‐
71               tified fields.  The fields are separated by the '|' character:
72
73               enscript --header='$n|%W|Page $% of $=' *.c
74
75               now  the  file name is printed left justified, the date is cen‐
76               tered to the header and the page numbers are printed right jus‐
77               tified.
78
79       -B, --no-header
80               Do not print page headers.
81
82       -c, --truncate-lines
83               Cut  lines  that  are  too  long  for  the page.  As a default,
84               enscript wraps long lines to the next line so no information is
85               lost.
86
87               You  can also use the --slice option which slices long lines to
88               separate pages.
89
90       -C[start_line], --line-numbers[=start_line]
91               Precede each line with its line number.  The optional  argument
92               start_line specifies the number of the first line in the input.
93               The number of the first line defaults to 1.
94
95       -d name Spool output to the printer name.
96
97       -D key[:value], --setpagedevice=key[:value]
98               Pass a page device definition to the generated PostScript  out‐
99               put.   If  no  value  is given, the key key is removed from the
100               definitions.
101
102               For example, the command
103
104               enscript -DDuplex:true foo.txt
105
106               prints file foo.txt in duplex (two side) mode.
107
108               Page device operators are implementation dependent but they are
109               standardized.  See section PAGE DEVICE OPTIONS for the details.
110
111       -e[char], --escapes[=char]
112               Enable  special  escapes  interpretation  (see  section SPECIAL
113               ESCAPES).  If the argument char is given, it changes the escape
114               character to char.  The default escape character is 0.
115
116       -E[lang], --highlight[=lang]
117               Highlight  source  code by creating a special input filter with
118               the states program.  The optional argument lang  specifies  the
119               language  to  highlight.  As a default the states makes an edu‐
120               cated guess.
121
122               You can print a short description of the supported highlighting
123               languages and file formats with the command:
124
125               enscript --help-highlight
126
127               The     highlighting     rules     are     defined    in    the
128               `/usr/share/enscript/hl/*.st' files which can be edited to cre‐
129               ate highlighting definitions for new languages.
130
131               Note! You can not use your own input filters with this option.
132
133       -f name, --font=name
134               Select a font that is used for the body text.  The default body
135               font is Courier10, unless multicolumn landscape  printing  mode
136               is selected, in which case the default font is Courier7.
137
138               The font specification name contains two parts: the name of the
139               font  and  its  size  in  PostScript  points.    For   example,
140               "Times-Roman12" selects the "Times-Roman" font with size 12pt.
141
142               The  font  specification  name  can  also  be  given  in format
143               `name@ptsize', where the name of the font and  its  point  size
144               are  separated by a `@' character.  This allows enscript to use
145               fonts which contain digit characters in their names.
146
147               The  font  point  size  can  also  be  given  in   the   format
148               width/height where the width and the height specify the size of
149               the   font   in   x-   and    y-directions.     For    example,
150               "Times-Roman@10/12" selects a 10 points wide and 12 points high
151               "Times-Roman" font.
152
153               You can also give the font sizes as decimal numbers.  For exam‐
154               ple, "Times-Roman10.2" selects a 10.2pt "Times-Roman" font.
155
156       -F name, --header-font=name
157               Select a font for the header texts.
158
159       -g, --print-anyway
160               Print  a  file  even if it contains binary data.  The option is
161               implemented only for compatibility purposes.   Enscript  prints
162               binary files anyway regardless of the option.
163
164       -G, --fancy-header[=name]
165               Print  a  fancy  page header name to the top of each page.  The
166               option -G specifies the default fancy header.  See section CON‐
167               FIGURATION  FILES  to  see  how the default fancy header can be
168               changed.
169
170       -h, --no-job-header
171               Suppress printing of the job header page.
172
173       -H[num], --highlight-bars[=num]
174               Specify how high the highlight bars are in lines.  If  the  num
175               is  not  given,  the default value 2 is used.  As a default, no
176               highlight bars are printed.
177
178       -i num, --indent=num
179               Indent every line num characters.  The indentation can also  be
180               specified  in  other units by appending an unit specifier after
181               the number.  The possible unit specifiers and the corresponding
182               units are:
183
184               c       centimeters
185
186               i       inches
187
188               l       characters (default)
189
190               p       PostScript points
191
192       -I filter, --filter=filter
193               Read all input files through an input filter filter.  The input
194               filter can be a single command or a command pipeline.  The fil‐
195               ter  can  refer  to  the name of the input file with the escape
196               `%s'.  The name of the standard input can be changed  with  the
197               option `--filter-stdin'.
198
199               For  example,  the following command prints the file `foo.c' by
200               using only upper-case characters:
201
202               enscript --filter="cat %s | tr 'a-z' 'A-Z'" foo.c
203
204               The following command highlights  changes  which  are  made  to
205               files since the last checkout:
206
207               enscript --filter="rcsdiff %s | diffpp %s" -e *.c
208
209               To  include  the  string  "%s"  to the filter command, you must
210               write it as "%%s".
211
212       -j, --borders
213               Print borders around columns.
214
215       -J title
216               An alias for the option -t, --title.
217
218       -k, --page-prefeed
219               Enable page prefeed.
220
221       -K, --no-page-prefeed
222               Disable page prefeed (default).
223
224       -l, --lineprinter
225               Emulate lineprinter.  This option is a shortcut for the options
226               --lines-per-page=66, and --no-header.
227
228       -L num, --lines-per-page=num
229               Print  only  num lines for each page.  As a default, the number
230               of lines per page is computed from the height of the  page  and
231               from the size of the font.
232
233       -m, --mail
234               Send  a  mail notification to user after the print job has been
235               completed.
236
237       -M name, --media=name
238               Select an output media name.  Enscript's default  output  media
239               is Letter.
240
241       -n num, --copies=num
242               Print num copies of each page.
243
244       -N nl, --newline=nl
245               Select  the newline character.  The possible values for nl are:
246               n (unix newline, 0xa hex) and r (mac newline, 0xd hex).
247
248       -o file An alias for the option -p, --output.
249
250       -O, --missing-characters
251               Print a listing of character codes which couldn't be printed.
252
253       -p file, --output=file
254               Leave the output to file file.  If the file  is  `-',  enscript
255               sends the output to the standard output stdout.
256
257       -P name, --printer=name
258               Spool the output to the printer name.
259
260       -q, --quiet, --silent
261               Make  enscript  really  quiet.   Only  fatal error messages are
262               printed to stderr.
263
264       -r, --landscape
265               Print in the landscape mode; rotate page 90 degrees.
266
267       -R, --portrait
268               Print in the portrait mode (default).
269
270       -s num, --baselineskip=num
271               Specify the baseline skip in PostScript points.  The number num
272               can  be  given  as  a decimal number.  When enscript moves from
273               line to line, the current point y  coordinate  is  moved  (font
274               point  size  + baselineskip) points down.  The default baseline
275               skip is 1.
276
277       -S key[:value], --statusdict=key[:value]
278               Pass a statusdict definition to the generated  PostScript  out‐
279               put.   If  no  value  is given, the key key is removed from the
280               definitions.
281
282               The statusdict operators are implementation dependent; see  the
283               printer's documentation for the details.
284
285               For example, the command
286
287               enscript -Ssetpapertray:1 foo.txt
288
289               prints  the  file  foo.txt by using paper from the paper tray 1
290               (assuming that the printer supports paper tray selection).
291
292       -t title, --title=title
293               Set banner page's job title to title.  The option sets also the
294               name of the input file stdin.
295
296       -T num, --tabsize=num
297               Set the tabulator size to num characters.  The default is 8.
298
299       -u[text], --underlay[=text]
300               Print  the string text under every page.  The properties of the
301               text can be changed with  the  options  --ul-angle,  --ul-font,
302               --ul-gray, --ul-position, and --ul-style.
303
304               If  no text is given, the underlay is not printed.  This can be
305               used to remove an underlay text that  was  specified  with  the
306               `Underlay' configuration file option.
307
308       -U num, --nup=num
309               Print  num  logical  pages on each output page (N-up printing).
310               The values num must be a power of 2.
311
312       -v, --verbose[=level]
313               Tell what enscript is doing.
314
315       -V, --version
316               Print enscript version information and exit.
317
318       -w [lang], --language[=lang]
319               Generate output for the language lang.  The possible values for
320               lang are:
321
322               PostScript
323                       generate PostScript (default)
324
325               html    generate HTML
326
327               overstrike
328                       generate overstrikes (line printers, less)
329
330               rtf     generate RTF (Rich Text Format)
331
332               ansi    generate ANSI terminal control codes
333
334       -W, --option=app,option
335               Pass option option to helper application app
336
337       -X name, --encoding=name
338               Use  the  input encoding name.  Currently enscript supports the
339               following encodings:
340
341               88591, latin1
342                       ISO-8859-1 (ISO Latin1) (enscript's default encoding).
343
344               88592, latin2
345                       ISO-8859-2 (ISO Latin2)
346
347               88593, latin3
348                       ISO-8859-3 (ISO Latin3)
349
350               88594, latin4
351                       ISO-8859-4 (ISO Latin4)
352
353               88595, cyrillic
354                       ISO-8859-5 (ISO Cyrillic)
355
356               88597, greek
357                       ISO-8859-7 (ISO Greek)
358
359               88599, latin5
360                       ISO-8859-9 (ISO Latin5)
361
362               885910, latin6
363                       ISO-8859-10 (ISO Latin6)
364
365               885913, latin7
366                       ISO-8859-13 (ISO Latin7)
367
368               885915, latin9
369                       ISO-8859-15 (ISO Latin9)
370
371               ascii   7-bit ascii
372
373               asciifise, asciifi, asciise
374                       7-bit ascii with some  scandinavian  (Finland,  Sweden)
375                       extensions
376
377               asciidkno, asciidk, asciino
378                       7-bit  ascii  with  some scandinavian (Denmark, Norway)
379                       extensions
380
381               ibmpc, pc, dos
382                       IBM PC charset
383
384               mac     Mac charset
385
386               vms     VMS multinational charset
387
388               hp8     HP Roman-8 charset
389
390               koi8    Adobe Standard Cyrillic Font KOI8 charset
391
392               ps, PS  PostScript font's default encoding
393
394               pslatin1, ISOLatin1Encoding
395                       PostScript interpreter's `ISOLatin1Encoding'
396
397       -z, --no-formfeed
398               Turn off the form feed character interpretation.
399
400       -Z, --pass-through
401               Pass through all PostScript and PCL files without any modifica‐
402               tions.  This allows that enscript can be used as a lp filter.
403
404               The  PostScript  files  are  recognized  by looking up the `%!'
405               magic cookie from the beginning of  the  file.  Note!  Enscript
406               recognized also the Windoze damaged `^D%!' cookie.
407
408               The  PCL  files are recognized by looking up the `^[E' or `^[%'
409               magic cookies from the beginning of the file.
410
411       --color[=bool]
412               Use colors in the highlighting outputs.
413
414       --continuous-page-numbers
415               Count page numbers across input files. Don't restart  numbering
416               at beginning of each file.
417
418       --download-font=fontname
419               Include  the  font  description file (.pfa or .pfb file) of the
420               font fontname to the generated output.
421
422       --extended-return-values
423               Enable extended return values.  As a default, enscript  returns
424               1  on  error  and 0 otherwise.  The extended return values give
425               more details about the printing  operation.   See  the  section
426               RETURN VALUE for the details.
427
428       --filter-stdin=name
429               Specify  how  the  stdin  is  shown  to  the input filter.  The
430               default value is an empty string ("") but some programs require
431               that the stdin is called something else, usually "-".
432
433       --footer=footer
434               Use  the  text  footer  as a page footer.  Otherwise the option
435               works like the --header option
436
437       --h-column-height=height
438               Set the  horizontal  column  height  to  be  height  PostScript
439               points.   The  option sets the formfeed type to horizontal-col‐
440               umns.
441
442       --help  Print a short help message and exit.
443
444       --help-highlight
445               Describe all supported --highlight languages and file formats.
446
447       --highlight-bar-gray=gray
448               Specify the gray level which is used in printing the  highlight
449               bars.
450
451       --list-media
452               List the names of all known output media and exit successfully.
453
454       --margins=left:right:top:bottom
455               Adjust  the  page  marginals to be exactly left, right, top and
456               bottom PostScript points.  Any of the  arguments  can  be  left
457               empty in which case the default value is used.
458
459       --mark-wrapped-lines[=style]
460               Mark  wrapped  lines  in  the output with the style style.  The
461               possible values for the style are:
462
463               none    do not mark them (default)
464
465               plus    print a plus (+) character to the end of  each  wrapped
466                       line
467
468               box     print a black box to the end of each wrapped line
469
470               arrow   print a small arrow to the end of each wrapped line
471
472       --non-printable-format=format
473               Specify how the non-printable characters are printed.  The pos‐
474               sible values for the format are:
475
476               caret   caret notation: `^@', `^A', `^B', ...
477
478               octal   octal notation: `\000', `\001', `\002', ... (default)
479
480               questionmark
481                       replace non-printable characters with a  question  mark
482                       `?'
483
484               space   replace non-printable characters with a space ` '
485
486       --nup-columnwise
487               Change  the  layout  of the sub-pages in the N-up printing from
488               row-wise to columnwise.
489
490       --nup-xpad=num
491               Set the page x-padding of the n-up printing to  num  PostScript
492               points.  The default is 10 points.
493
494       --nup-ypad=num
495               Set  the  page y-padding of the n-up printing to num PostScript
496               points.  The default is 10 points.
497
498       --page-label-format=format
499               Set the page label format to format.   The  page  label  format
500               specifies  how the labels for the `%%Page:' PostScript comments
501               are formatted.  The possible values are:
502
503               short   Print the current pagenumber: `%%Page: (1) 1' (default)
504
505               long    Print the current  filename  and  pagenumber:  `%%Page:
506                       (main.c:  1) 1'
507
508       --ps-level=level
509               Set  the  PostScript  language level that enscript uses for its
510               output to level.  The possible values are 1, and 2.
511
512       --printer-options=options
513               Pass extra options to the printer command.
514
515       --rotate-even-pages
516               Rotate each even-numbered page 180 degrees.
517
518       --slice=num
519               Print the vertical slice num.  The slices are vertical  regions
520               of  input  files.   A new slice starts from the point where the
521               line would otherwise be wrapped to the next  line.   The  slice
522               numbers start from 1.
523
524       --style=style
525               Set  the highlighting style to style.  The possible values are:
526               a2ps, emacs, emacs_verbose, ifh, and msvc.
527
528       --swap-even-page-margins
529               Swap left and right page margins for even-numbered pages.
530
531       --toc   Print a table of contents to the end of the output.
532
533       --word-wrap
534               Wrap long lines from word boundaries.
535
536       --ul-angle=angle
537               Set the angle of the underlay text to angle.  As a default, the
538               angle is atan(-d_page_h, d_page_w).
539
540       --ul-font=name
541               Select a font for the underlay text.  The default underlay font
542               is Times-Roman200.
543
544       --ul-gray=num
545               Print the underlay text with the gray value num (0 ... 1),  the
546               default gray value is .8.
547
548       --ul-position=position_spec
549               Set  the  underlay  text's  starting  position according to the
550               position_spec.  The position specification  must  be  given  in
551               format:  `sign  xpos  sign ypos', where the sign must be `+' or
552               `-'.  The positive dimensions are measured from the lower  left
553               corner and the negative dimensions from the upper right corner.
554               For example, the specification `+0-0' specifies the upper  left
555               corner and `-0+0' specifies the lower right corner.
556
557       --ul-style=style
558               Set  the  underlay  text's style to style.  The possible values
559               for style are:
560
561               outline print outline underlay texts (default)
562
563               filled  print filled underlay texts
564
565

CONFIGURATION FILES

567       Enscript reads configuration information from the following sources (in
568       this  order):  command  line  options,  environment  variable ENSCRIPT,
569       user's personal configuration file ($HOME/.enscriptrc), site configura‐
570       tion  file  (/etc/enscriptsite.cfg)  and  system's global configuration
571       file (/etc/enscript.cfg).
572
573       The configuration files have the following format:
574
575       Empty lines and lines starting with `#' are comments.
576
577       All other lines are option lines and have format:
578
579       option [arguments ...].
580
581       The following options can be specified:
582
583       AcceptCompositeCharacters: bool
584               Specify whether  PostScript  font's  composite  characters  are
585               accepted  as  printable or if they should be considered as non-
586               existent.  The default value is false (0).
587
588       AFMPath: path
589               Specifies the search path for the AFM files.
590
591       AppendCtrlD: bool
592               Specify if the Control-D (^D) character should be  appended  to
593               the end of the output.  The default value is false (0).
594
595       Clean7Bit: bool
596               Specify  how characters greater than 127 are printed.  The val‐
597               uee true (1) generates 7-bit clean code by escaping all charac‐
598               ters   greater   than   127  to  the  backslash-octal  notation
599               (default).  The value false (0) generates 8-bit PostScript code
600               leaving all characters untouched.
601
602       DefaultEncoding: name
603               Select  the default input encoding.  The encoding name name can
604               be one of the values of the option -X, --encoding.
605
606       DefaultFancyHeader: name
607               Select the default fancy header.  The default  header  is  used
608               when the option -G is specified or the option --fancy-header is
609               given  without  an  argument.   The  system-wide   default   is
610               `enscript'.
611
612       DefaultMedia: name
613               Select the default output media.
614
615       DefaultOutputMethod: method
616               Select  the  default  target  to  which the generated output is
617               sent.  The possible values for the method are:
618
619               printer send output to printer (default)
620
621               stdout  send output to stdout
622
623       DownloadFont: fontname
624               Include the font description file of the font fontname  to  the
625               generated output.
626
627       EscapeChar: num
628               Specify  the  escape  character  for  the special escapes.  The
629               default value is 0.
630
631       FormFeedType: type
632               Specify what to do when a  formfeed  character  is  encountered
633               from the input.  The possible values for type are:
634
635               column  move to the beginning of the next column (default)
636
637               page    move to the beginning of the next page
638
639       GeneratePageSize: bool
640               Specify  whether  the PageSize page device setting is generated
641               to the PostScript output.  The default value is true (1).
642
643       HighlightBarGray: gray
644               Specify the gray level which is used  to  print  the  highlight
645               bars.
646
647       HighlightBars: num
648               Specify  how high the highlight bars are in lines.  The default
649               value is 0 which means that no highlight bars are printed.
650
651       LibraryPath: path
652               Specifies the enscript's library path that is  used  to  lookup
653               various      resources.       The      default     path     is:
654               `/usr/share/enscript:home/.enscript'.  Where the  home  is  the
655               user's home directory.
656
657       MarkWrappedLines: style
658               Mark wraped lines in the output with the style style.  The pos‐
659               sible values for the format are the same which can be given for
660               the --mark-wrapped-lines option.
661
662       Media: name width height llx lly urx ury
663               Add a new output media with the name name.  The physical dimen‐
664               sions of the media are width and height.  The bounding  box  of
665               the Media is specified by the points (llx, lly) and (urx, ury).
666               Enscript prints all graphics inside the  bounding  box  of  the
667               media.
668
669               User can select this media with option -M name.
670
671       NoJobHeaderSwitch: switch
672               Specify  the  spooler  option  to suppress the print job header
673               page.  This option is passed to the printer  spooler  when  the
674               enscript's option -h, --no-job-header is selected.
675
676       NonPrintableFormat: format
677               Specify how the non-printable characters are printed.  The pos‐
678               sible values for format are the same which can be given for the
679               --non-printable-format option.
680
681       OutputFirstLine: line
682               Set  the  PostScript  output's first line to line.  The default
683               value is PS-Adobe-3.0.  Since some printers  do  not  like  DSC
684               levels  greater than 2.0, this option can be used to change the
685               output  first  line  to  something  more  suitable  like  %!PS-
686               Adobe-2.0 or %!.
687
688       PageLabelFormat: format
689               Set  the  page label format to format.  The possible values for
690               format  are   the   same   which   can   be   given   for   the
691               --page-label-format option.
692
693       PagePrefeed: bool
694               Enable / disable page prefeed.  The default value is false (0).
695
696       PostScriptLevel: level
697               Set  the  PostScript language level, that enscript uses for its
698               output, to level.  The possible values for level are  the  same
699               which can be given for the --ps-level option.
700
701       Printer: name
702               Names the printer to which the output is spooled.
703
704       QueueParam: name
705               The spooler command switch to select the printer queue, e.g. -P
706               in lpr -Pps.  This option can also be used to pass other  flags
707               to the spooler command.  These options must be given before the
708               queue switch.
709
710       SetPageDevice: key[:value]
711               Pass a page device definition to the generated PostScript  out‐
712               put.
713
714       Spooler: name
715               Names  the  printer  spooler command.  Enscript pipes generated
716               PostScript to the command name.
717
718       StatesBinary: path
719               Define an absolute path to the states program.
720
721       StatesColor: bool
722               Should the states program generate color outputs.
723
724       StatesConfigFile: file
725               Read highlighting states configuration from the file file.  The
726               default config file is `/usr/share/enscript/hl/enscript.st'.
727
728       StatesHighlightStyle: style
729               Set the highlight style to style.
730
731       StatesPath: path
732               Define  the  path  for  the states program.  The states program
733               will lookup its state definition files  from  this  path.   The
734               default value is `$HOME/.enscript:/usr/share/enscript/hl'.
735
736       StatusDict: key[:value]
737               Pass  a  statusdict definition to the generated PostScript out‐
738               put.
739
740       TOCFormat: format
741               Format table of contents entries with the format string format.
742               The format string format can contain the same escapes which are
743               used to format header strings with the `%Format'  special  com‐
744               ment.
745
746       Underlay: text
747               Print string text under every page.
748
749       UnderlayAngle: num
750               Set the angle of the underlay text to num.
751
752       UnderlayFont: fontspec
753               Select a font for the underlay text.
754
755       UnderlayGray: num
756               Print the underlay text with the gray value num.
757
758       UnderlayPosition: position_spec
759               Set  the  underlay  text's  starting  position according to the
760               position_spec.
761
762       UnderlayStyle: style
763               Set the underlay text's style to style.
764
765

FANCY HEADERS

767       Users can create their own fancy headers by creating a header  descrip‐
768       tion  file and placing it in a directory which is in enscript's library
769       path.  The name of the header file must be in format: `headername.hdr'.
770       Header can be selected by giving option: --fancy-header=headername.
771
772       Header  description  file  contains  PostScript  code  that  paints the
773       header.  Description file must provide  procedure  do_header  which  is
774       called by enscript at the beginning of every page.
775
776       Header  description  file contains two parts: comments and code.  Parts
777       are separated by a line containing text:
778
779       % -- code follows this line --
780
781       Enscript copies only the code part of description file to the generated
782       PostScript  output.   The comments part can contain any data, it is not
783       copied.  If separator line is missing, no data is copied to output.
784
785       Enscript defines following  constants  which  can  be  used  in  header
786       description files:
787
788       d_page_w        page width
789
790       d_page_h        page height
791
792       d_header_x      header lower left x coordinate
793
794       d_header_y      header lower left y coordinate
795
796       d_header_w      header width
797
798       d_header_h      header height
799
800       d_footer_x      footer lower left x coordinate
801
802       d_footer_y      footer lower left y coordinate
803
804       d_footer_w      footer width
805
806       d_footer_h      footer height
807
808       d_output_w      width of the text output area
809
810       d_output_h      height of the text output area
811
812       user_header_p   predicate  which  tells if user has defined his/her own
813                       header string: true/false
814
815       user_header_left_str
816                       if user_header_p is true, this is the left field of the
817                       user supplied header string.
818
819       user_header_center_str
820                       if  user_header_p  is true, this is the center field of
821                       the user supplied header string
822
823       user_header_right_str
824                       if user_header_p is true, this is the  right  field  of
825                       the user supplied header string
826
827       user_footer_p   predicate  which  tells if user has defined his/her own
828                       footer string: true/false
829
830       user_footer_left_str
831                       if user_footer_p is true, this is the left field of the
832                       user supplied footer string.
833
834       user_footer_center_str
835                       if  user_footer_p  is true, this is the center field of
836                       the user supplied footer string
837
838       user_footer_right_str
839                       if user_footer_p is true, this is the  right  field  of
840                       the user supplied footer string
841
842       HF              standard  header  font (from -F, --header-font option).
843                       This can be selected simply by  invoking  command:  `HF
844                       setfont'.
845
846       pagenum         the number of the current page
847
848       fname           the full name of the printed file (/foo/bar.c)
849
850       fdir            the directory part of the file name (/foo)
851
852       ftail           file name without the directory part (bar.c)
853
854       gs_languagelevel
855                       PostScript interpreter's language level (currently 1 or
856                       2)
857
858       You can also use the following special comments to customize your head‐
859       ers  and  to specify some extra options.  Special comments are like DSC
860       comments but they start with a single `%' character;  special  comments
861       start  from  the beginning of the line and they have the following syn‐
862       tax:
863
864       %commentname: options
865
866       Currently enscript support the following special comments:
867
868       %Format: name format
869               Define a new string  constant  name  according  to  the  format
870               string  format.   Format  string start from the first non-space
871               character and it ends to the end of the  line.   Format  string
872               can  contain  general  `%'  escapes  and input file related `$'
873               escapes.  Currently following escapes are supported:
874
875               %%      character `%'
876
877               $$      character `$'
878
879               $%      current page number
880
881               $=      number of pages in the current file
882
883               $p      number of pages processed so far
884
885               $(VAR)  value of the environment variable VAR.
886
887               %c      trailing component of the current working directory
888
889               %C ($C) current time (file  modification  time)  in  `hh:mm:ss'
890                       format
891
892               %d      current working directory
893
894               %D ($D) current  date  (file  modification  date) in `yy-mm-dd'
895                       format
896
897               %D{string} ($D{string})
898                       format string string  with  the  strftime(3)  function.
899                       `%D{}'  refers  to  the  current date and `$D{}' to the
900                       input file's last modification date.
901
902               %E ($E) current date (file  modification  date)  in  `yy/mm/dd'
903                       format
904
905               %F ($F) current  date  (file modification date) in `dd.mm.yyyy'
906                       format
907
908               %H      document title
909
910               $L      number of lines in the current  input  file.   This  is
911                       valid  only  for  the  toc entries, it can't be used in
912                       header strings.
913
914               %m      the hostname up to the first `.' character
915
916               %M      the full hostname
917
918               %n      the user login name
919
920               $n      input file name without the directory part
921
922               %N      the user's pw_gecos field up to the first `,' character
923
924               $N      the full input file name
925
926               %t ($t) current time (file modification time) in 12-hour  am/pm
927                       format
928
929               %T ($T) current time (file modification time) in 24-hour format
930                       `hh:mm'
931
932               %* ($*) current time (file modification time) in 24-hour format
933                       with seconds `hh:mm:ss'
934
935               $v      the sequence number of the current input file
936
937               $V      the  sequence  number  of the current input file in the
938                       `Table of Contents' format:  if  the  --toc  option  is
939                       given,  escape  expands  to `num-'; if the --toc is not
940                       given, escape expands to an empty string.
941
942               %W ($W) current date (file  modification  date)  in  `mm/dd/yy'
943                       format
944
945               All format directives except `$=' can also be given in format
946
947               escape width directive
948
949               where  width  specifies  the  width  of the column to which the
950               escape is printed.  For example, escape "$5%"  will  expand  to
951               something like " 12".  If the width is negative, the value will
952               be printed left-justified.
953
954               For example, the `emacs.hdr' defines its date string  with  the
955               following format comment:
956
957               %Format: eurdatestr %E
958
959               which expands to:
960
961               /eurdatestr (96/01/08) def
962
963       %HeaderHeight: height
964               Allocate  height points space for the page header.  The default
965               header height is 36 points.
966
967       %FooterHeight: height
968               Allocate height points space for the page footer.  The  default
969               footer height is 0 points.
970
971       According  to  Adobe's  Document  Structuring  Conventions  (DSC),  all
972       resources needed by a document must be  listed  in  document's  prolog.
973       Since  user's  can  create  their own headers, enscript don't know what
974       resources those headers use.  That's why all  headers  must  contain  a
975       standard  DSC  comment  that  lists all needed resources.  For example,
976       used fonts can be listed with following comment:
977
978       %%DocumentNeededResources: font fontname1 fontname2
979
980       Comment can be continued to the next line with the  standard  continua‐
981       tion comment:
982
983       %%+ font fontname3
984
985

SPECIAL ESCAPES

987       Enscript  supports  special  escape  sequences which can be used to add
988       some page formatting commands to ASCII documents.  As a  default,  spe‐
989       cial  escapes  interpretation  is  off, so all ASCII files print out as
990       everyone expects.  Special escapes interpretation is activated by  giv‐
991       ing option -e, --escapes to enscript.
992
993       All  special  escapes  start  with  the  escape character.  The default
994       escape character is ^@ (octal 000); escape  character  can  be  changed
995       with  option  -e,  --escapes.  Escape character is followed by escape's
996       name and optional options and arguments.
997
998       Currently enscript supports following escapes:
999
1000       bgcolor change the text background color.  The syntax of the escape is:
1001
1002               ^@bgcolor{red green blue}
1003
1004               where the color components red, green, and blue  are  given  as
1005               decimal numbers between values 0 and 1.
1006
1007
1008       bggray  change the text background color.  The syntax of the escape is:
1009
1010               ^@bggray{gray}
1011
1012               where  gray is the new text background gray value.  The default
1013               value is 1.0 (white).
1014
1015       color   change the text color.  The syntax of the escape is:
1016
1017               ^@color{red green blue}
1018
1019               where color components red, green and blue are given as decimal
1020               numbers between values 0 and 1.
1021
1022       comment comment  the  rest of the line including the newline character.
1023               Escape's syntax is:
1024
1025               ^@comment text newline_character
1026
1027       escape  change the escape character.  The syntax of the escape is:
1028
1029               ^@escape{code}
1030
1031               where code is the decimal code of the new escape character.
1032
1033       epsf    inline EPS file to the document.  The syntax of the escape is:
1034
1035               ^@epsf[options]{filename}
1036
1037               where options is an optional sequence of option characters  and
1038               values  enclosed  with brackets and filename is the name of the
1039               EPS file.
1040
1041               If filename ends to the `|' character, then filename is assumed
1042               to  name a command that prints EPS data to its standard output.
1043               In this case, enscript opens a pipe to  the  specified  command
1044               and reads EPS data from pipe.
1045
1046               Following options can be given for the epsf escape:
1047
1048               c       print image centered
1049
1050               r       print image right justified
1051
1052               n       do  not  update  current  point.   Following  output is
1053                       printed to that position where the  current  point  was
1054                       just before the epsf escape
1055
1056               nx      do not update current point x coordinate
1057
1058               ny      do not update current point y coordinate
1059
1060               xnum    move  image's top left x coordinate num characters from
1061                       current point x coordinate (relative position)
1062
1063               xnuma   set image's top left x coordinate to column num  (abso‐
1064                       lute position)
1065
1066               ynum    move  image's top left y coordinate num lines from cur‐
1067                       rent line (relative position)
1068
1069               ynuma   set image's top left y coordinate to line num (absolute
1070                       position)
1071
1072               hnum    set image's height to num lines
1073
1074               snum    scale image with factor num
1075
1076               sxnum   scale image in x direction with factor num
1077
1078               synum   scale image in y direction with factor num
1079
1080               As  a default, all dimensions are given in lines (vertical) and
1081               characters (horizontal).  You can also specify other  units  by
1082               appending an unit specifier after number.  Possible unit speci‐
1083               fiers and the corresponding units are:
1084
1085               c       centimeters
1086
1087               i       inches
1088
1089               l       lines or characters (default)
1090
1091               p       PostScript points
1092
1093               For example to print an image one inch high,  you  can  specify
1094               height  by  following  options: h1i (1 inch), h2.54c (2.54 cm),
1095               h72p (72 points).
1096
1097       font    select current font.  The syntax of the escape is:
1098
1099               ^@font{fontname[:encoding]}
1100
1101               where fontname is a standard font specification.  Special  font
1102               specification  default  can  be used to select the default body
1103               font (enscript's default or the one specified  by  the  command
1104               line option -f, --font).
1105
1106               The  optional  argument  encoding  specifies  the encoding that
1107               should be used for the new font.  Currently  the  encoding  can
1108               only be the enscript's global input encoding or ps.
1109
1110       ps      include  raw  PostScript code to the output.  The syntax of the
1111               escape is:
1112
1113               ^@ps{code}
1114
1115       shade   highlight regions of  text  by  changing  the  text  background
1116               color.  Escape's syntax is:
1117
1118               ^@shade{gray}
1119
1120               where  gray is the new text background gray value.  The default
1121               value is 1.0 (white) which disables highlighting.
1122
1123

PAGE DEVICE OPTIONS

1125       Page device is a PostScript level 2  feature  that  offers  an  uniform
1126       interface  to  control  printer's output device.  Enscript protects all
1127       page device options inside an if block so they have no effect in  level
1128       1 interpreters.  Although all level 2 interpreters support page device,
1129       they do not have to support all page device options.  For example  some
1130       printers can print in duplex mode and some can not.  Refer to the docu‐
1131       mentation of your printer for supported options.
1132
1133       Here are some usable page device options which can be selected with the
1134       -D,  --setpagedevice  option.   For  a complete listing, see PostScript
1135       Language Reference Manual: section 4.11 Device Setup.
1136
1137       Collate boolean
1138               how output is organized when printing multiple copies
1139
1140       Duplex boolean
1141               duplex (two side) printing
1142
1143       ManualFeed boolean
1144               manual feed paper tray
1145
1146       OutputFaceUp boolean
1147               print output `face up' or `face down'
1148
1149       Tumble boolean
1150               how opposite sides are positioned in duplex printing
1151
1152

PRINTING EXAMPLES

1154       Following printing examples assume that enscript uses the default  con‐
1155       figuration.   If  default actions have been changed from the configura‐
1156       tion files, some examples will behave differently.
1157
1158       enscript foo.txt
1159               Print file foo.txt to the default printer.
1160
1161       enscript -Possu foo.txt
1162               Print file foo.txt to printer ossu.
1163
1164       enscript -pfoo.ps foo.txt
1165               Print file foo.txt, but leave PostScript output to file foo.ps.
1166
1167       enscript -2 foo.txt
1168               Print file foo.txt to two columns.
1169
1170       enscript -2r foo.txt
1171               Print file to two columns and rotate output 90  degrees  (land‐
1172               scape).
1173
1174       enscript -DDuplex:true foo.txt
1175               Print file in duplex (two side) mode (printer dependent).
1176
1177       enscript -G2rE -U2 foo.c
1178               My  default  code  printing command: gaudy header, two columns,
1179               landscape, code highlighting, 2-up printing.
1180
1181       enscript -E --color -whtml --toc -pfoo.html *.h *.c
1182               A nice HTML report of your project's C source files.
1183
1184

ENVIRONMENT VARIABLES

1186       The environment variable ENSCRIPT can be used to pass  default  options
1187       for  enscript.   For  example,  to  select  the default body font to be
1188       Times-Roman 7pt, set the following value to  the  ENSCRIPT  environment
1189       variable:
1190
1191       -fTimes-Roman7
1192
1193       The value of the ENSCRIPT variable is processed before the command line
1194       options, so command  line  options  can  be  used  to  overwrite  these
1195       defaults.
1196
1197       Variable  ENSCRIPT_LIBRARY  specifies the enscript's library directory.
1198       It can be used to overwrite the build-in default `/usr/share/enscript'.
1199
1200

RETURN VALUE

1202       Enscript returns value 1 to the shell if any errors were encountered or
1203       0 otherwise.  If the option --extended-return-values was specified, the
1204       return value is constructed from the following flags:
1205
1206       0       no errors or warnings
1207
1208       2       some lines were truncated or wrapped
1209
1210       4       some characters were missing from the used fonts
1211
1212       8       some characters were unprintable
1213
1214

FILES

1216       /usr/share/enscript/*.hdr               header files
1217       /usr/share/enscript/*.enc               input encoding vectors
1218       /usr/share/enscript/enscript.pro        PostScript prolog
1219       /usr/share/enscript/afm/*.afm           AFM files for PostScript fonts
1220       /usr/share/enscript/font.map            index for the AFM files
1221       /usr/share/enscript/hl/*.st             states definition files
1222       /etc/enscript.cfg                       system-wide configuration file
1223       /etc/enscriptsite.cfg                   site configuration file
1224       ~/.enscriptrc                           personal configuration file
1225       ~/.enscript/                            personal resource directory
1226
1227

SEE ALSO

1229       diffpp(1), ghostview(1), gs(1), lpq(1), lpr(1), lprm(1), states(1)
1230
1231

AUTHOR

1233       Markku Rossi <mtr@iki.fi> <http://www.iki.fi/~mtr/>
1234
1235       GNU Enscript WWW home page: <http://www.iki.fi/~mtr/genscript/>
1236
1237
1238
1239ENSCRIPT                         Mar 12, 1999                      ENSCRIPT(1)
Impressum