1ENSCRIPT(1) ENSCRIPT ENSCRIPT(1)
2
3
4
6 enscript - convert text files to PostScript, HTML, RTF, ANSI, and over‐
7 strikes
8
9
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
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
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 ascii 7-bit ascii
366
367 asciifise, asciifi, asciise
368 7-bit ascii with some scandinavian (Finland, Sweden)
369 extensions
370
371 asciidkno, asciidk, asciino
372 7-bit ascii with some scandinavian (Denmark, Norway)
373 extensions
374
375 ibmpc, pc, dos
376 IBM PC charset
377
378 mac Mac charset
379
380 vms VMS multinational charset
381
382 hp8 HP Roman-8 charset
383
384 koi8 Adobe Standard Cyrillic Font KOI8 charset
385
386 ps, PS PostScript font's default encoding
387
388 pslatin1, ISOLatin1Encoding
389 PostScript interpreter's `ISOLatin1Encoding'
390
391 -z, --no-formfeed
392 Turn off the form feed character interpretation.
393
394 -Z, --pass-through
395 Pass through all PostScript and PCL files without any modifica‐
396 tions. This allows that enscript can be used as a lp filter.
397
398 The PostScript files are recognized by looking up the `%!'
399 magic cookie from the beginning of the file. Note! Enscript
400 recognized also the Windoze damaged `^D%!' cookie.
401
402 The PCL files are recognized by looking up the `^[E' or `^[%'
403 magic cookies from the beginning of the file.
404
405 --color[=bool]
406 Use colors in the highlighting outputs.
407
408 --continuous-page-numbers
409 Count page numbers across input files. Don't restart numbering
410 at beginning of each file.
411
412 --download-font=fontname
413 Include the font description file (.pfa or .pfb file) of the
414 font fontname to the generated output.
415
416 --extended-return-values
417 Enable extended return values. As a default, enscript returns
418 1 on error and 0 otherwise. The extended return values give
419 more details about the printing operation. See the section
420 RETURN VALUE for the details.
421
422 --filter-stdin=name
423 Specify how the stdin is shown to the input filter. The
424 default value is an empty string ("") but some programs require
425 that the stdin is called something else, usually "-".
426
427 --footer=footer
428 Use the text footer as a page footer. Otherwise the option
429 works like the --header option
430
431 --h-column-height=height
432 Set the horizontal column height to be height PostScript
433 points. The option sets the formfeed type to horizontal-col‐
434 umns.
435
436 --help Print a short help message and exit.
437
438 --help-highlight
439 Describe all supported --highlight languages and file formats.
440
441 --highlight-bar-gray=gray
442 Specify the gray level which is used in printing the highlight
443 bars.
444
445 --list-media
446 List the names of all known output media and exit successfully.
447
448 --margins=left:right:top:bottom
449 Adjust the page marginals to be exactly left, right, top and
450 bottom PostScript points. Any of the arguments can be left
451 empty in which case the default value is used.
452
453 --mark-wrapped-lines[=style]
454 Mark wrapped lines in the output with the style style. The
455 possible values for the style are:
456
457 none do not mark them (default)
458
459 plus print a plus (+) character to the end of each wrapped
460 line
461
462 box print a black box to the end of each wrapped line
463
464 arrow print a small arrow to the end of each wrapped line
465
466 --non-printable-format=format
467 Specify how the non-printable characters are printed. The pos‐
468 sible values for the format are:
469
470 caret caret notation: `^@', `^A', `^B', ...
471
472 octal octal notation: `\000', `\001', `\002', ... (default)
473
474 questionmark
475 replace non-printable characters with a question mark
476 `?'
477
478 space replace non-printable characters with a space ` '
479
480 --nup-columnwise
481 Change the layout of the sub-pages in the N-up printing from
482 row-wise to columnwise.
483
484 --nup-xpad=num
485 Set the page x-padding of the n-up printing to num PostScript
486 points. The default is 10 points.
487
488 --nup-ypad=num
489 Set the page y-padding of the n-up printing to num PostScript
490 points. The default is 10 points.
491
492 --page-label-format=format
493 Set the page label format to format. The page label format
494 specifies how the labels for the `%%Page:' PostScript comments
495 are formatted. The possible values are:
496
497 short Print the current pagenumber: `%%Page: (1) 1' (default)
498
499 long Print the current filename and pagenumber: `%%Page:
500 (main.c: 1) 1'
501
502 --ps-level=level
503 Set the PostScript language level that enscript uses for its
504 output to level. The possible values are 1, and 2.
505
506 --printer-options=options
507 Pass extra options to the printer command.
508
509 --rotate-even-pages
510 Rotate each even-numbered page 180 degrees.
511
512 --slice=num
513 Print the vertical slice num. The slices are vertical regions
514 of input files. A new slice starts from the point where the
515 line would otherwise be wrapped to the next line. The slice
516 numbers start from 1.
517
518 --style=style
519 Set the highlighting style to style. The possible values are:
520 a2ps, emacs, emacs_verbose, ifh, and msvc.
521
522 --swap-even-page-margins
523 Swap left and right page margins for even-numbered pages.
524
525 --toc Print a table of contents to the end of the output.
526
527 --word-wrap
528 Wrap long lines from word boundaries.
529
530 --ul-angle=angle
531 Set the angle of the underlay text to angle. As a default, the
532 angle is atan(-d_page_h, d_page_w).
533
534 --ul-font=name
535 Select a font for the underlay text. The default underlay font
536 is Times-Roman200.
537
538 --ul-gray=num
539 Print the underlay text with the gray value num (0 ... 1), the
540 default gray value is .8.
541
542 --ul-position=position_spec
543 Set the underlay text's starting position according to the
544 position_spec. The position specification must be given in
545 format: `sign xpos sign ypos', where the sign must be `+' or
546 `-'. The positive dimensions are measured from the lower left
547 corner and the negative dimensions from the upper right corner.
548 For example, the specification `+0-0' specifies the upper left
549 corner and `-0+0' specifies the lower right corner.
550
551 --ul-style=style
552 Set the underlay text's style to style. The possible values
553 for style are:
554
555 outline print outline underlay texts (default)
556
557 filled print filled underlay texts
558
559
561 Enscript reads configuration information from the following sources (in
562 this order): command line options, environment variable ENSCRIPT,
563 user's personal configuration file ($HOME/.enscriptrc), site configura‐
564 tion file (/etc/enscriptsite.cfg) and system's global configuration
565 file (/etc/enscript.cfg).
566
567 The configuration files have the following format:
568
569 Empty lines and lines starting with `#' are comments.
570
571 All other lines are option lines and have format:
572
573 option [arguments ...].
574
575 The following options can be specified:
576
577 AcceptCompositeCharacters: bool
578 Specify whether PostScript font's composite characters are
579 accepted as printable or if they should be considered as non-
580 existent. The default value is false (0).
581
582 AFMPath: path
583 Specifies the search path for the AFM files.
584
585 AppendCtrlD: bool
586 Specify if the Control-D (^D) character should be appended to
587 the end of the output. The default value is false (0).
588
589 Clean7Bit: bool
590 Specify how characters greater than 127 are printed. The val‐
591 uee true (1) generates 7-bit clean code by escaping all charac‐
592 ters greater than 127 to the backslash-octal notation
593 (default). The value false (0) generates 8-bit PostScript code
594 leaving all characters untouched.
595
596 DefaultEncoding: name
597 Select the default input encoding. The encoding name name can
598 be one of the values of the option -X, --encoding.
599
600 DefaultFancyHeader: name
601 Select the default fancy header. The default header is used
602 when the option -G is specified or the option --fancy-header is
603 given without an argument. The system-wide default is
604 `enscript'.
605
606 DefaultMedia: name
607 Select the default output media.
608
609 DefaultOutputMethod: method
610 Select the default target to which the generated output is
611 sent. The possible values for the method are:
612
613 printer send output to printer (default)
614
615 stdout send output to stdout
616
617 DownloadFont: fontname
618 Include the font description file of the font fontname to the
619 generated output.
620
621 EscapeChar: num
622 Specify the escape character for the special escapes. The
623 default value is 0.
624
625 FormFeedType: type
626 Specify what to do when a formfeed character is encountered
627 from the input. The possible values for type are:
628
629 column move to the beginning of the next column (default)
630
631 page move to the beginning of the next page
632
633 GeneratePageSize: bool
634 Specify whether the PageSize page device setting is generated
635 to the PostScript output. The default value is true (1).
636
637 HighlightBarGray: gray
638 Specify the gray level which is used to print the highlight
639 bars.
640
641 HighlightBars: num
642 Specify how high the highlight bars are in lines. The default
643 value is 0 which means that no highlight bars are printed.
644
645 LibraryPath: path
646 Specifies the enscript's library path that is used to lookup
647 various resources. The default path is:
648 `/usr/share/enscript:home/.enscript'. Where the home is the
649 user's home directory.
650
651 MarkWrappedLines: style
652 Mark wraped lines in the output with the style style. The pos‐
653 sible values for the format are the same which can be given for
654 the --mark-wrapped-lines option.
655
656 Media: name width height llx lly urx ury
657 Add a new output media with the name name. The physical dimen‐
658 sions of the media are width and height. The bounding box of
659 the Media is specified by the points (llx, lly) and (urx, ury).
660 Enscript prints all graphics inside the bounding box of the
661 media.
662
663 User can select this media with option -M name.
664
665 NoJobHeaderSwitch: switch
666 Specify the spooler option to suppress the print job header
667 page. This option is passed to the printer spooler when the
668 enscript's option -h, --no-job-header is selected.
669
670 NonPrintableFormat: format
671 Specify how the non-printable characters are printed. The pos‐
672 sible values for format are the same which can be given for the
673 --non-printable-format option.
674
675 OutputFirstLine: line
676 Set the PostScript output's first line to line. The default
677 value is PS-Adobe-3.0. Since some printers do not like DSC
678 levels greater than 2.0, this option can be used to change the
679 output first line to something more suitable like %!PS-
680 Adobe-2.0 or %!.
681
682 PageLabelFormat: format
683 Set the page label format to format. The possible values for
684 format are the same which can be given for the
685 --page-label-format option.
686
687 PagePrefeed: bool
688 Enable / disable page prefeed. The default value is false (0).
689
690 PostScriptLevel: level
691 Set the PostScript language level, that enscript uses for its
692 output, to level. The possible values for level are the same
693 which can be given for the --ps-level option.
694
695 Printer: name
696 Names the printer to which the output is spooled.
697
698 QueueParam: name
699 The spooler command switch to select the printer queue, e.g. -P
700 in lpr -Pps. This option can also be used to pass other flags
701 to the spooler command. These options must be given before the
702 queue switch.
703
704 SetPageDevice: key[:value]
705 Pass a page device definition to the generated PostScript out‐
706 put.
707
708 Spooler: name
709 Names the printer spooler command. Enscript pipes generated
710 PostScript to the command name.
711
712 StatesBinary: path
713 Define an absolute path to the states program.
714
715 StatesColor: bool
716 Should the states program generate color outputs.
717
718 StatesConfigFile: file
719 Read highlighting states configuration from the file file. The
720 default config file is `/usr/share/enscript/hl/enscript.st'.
721
722 StatesHighlightStyle: style
723 Set the highlight style to style.
724
725 StatesPath: path
726 Define the path for the states program. The states program
727 will lookup its state definition files from this path. The
728 default value is `$HOME/.enscript:/usr/share/enscript/hl'.
729
730 StatusDict: key[:value]
731 Pass a statusdict definition to the generated PostScript out‐
732 put.
733
734 TOCFormat: format
735 Format table of contents entries with the format string format.
736 The format string format can contain the same escapes which are
737 used to format header strings with the `%Format' special com‐
738 ment.
739
740 Underlay: text
741 Print string text under every page.
742
743 UnderlayAngle: num
744 Set the angle of the underlay text to num.
745
746 UnderlayFont: fontspec
747 Select a font for the underlay text.
748
749 UnderlayGray: num
750 Print the underlay text with the gray value num.
751
752 UnderlayPosition: position_spec
753 Set the underlay text's starting position according to the
754 position_spec.
755
756 UnderlayStyle: style
757 Set the underlay text's style to style.
758
759
761 Users can create their own fancy headers by creating a header descrip‐
762 tion file and placing it in a directory which is in enscript's library
763 path. The name of the header file must be in format: `headername.hdr'.
764 Header can be selected by giving option: --fancy-header=headername.
765
766 Header description file contains PostScript code that paints the
767 header. Description file must provide procedure do_header which is
768 called by enscript at the beginning of every page.
769
770 Header description file contains two parts: comments and code. Parts
771 are separated by a line containing text:
772
773 % -- code follows this line --
774
775 Enscript copies only the code part of description file to the generated
776 PostScript output. The comments part can contain any data, it is not
777 copied. If separator line is missing, no data is copied to output.
778
779 Enscript defines following constants which can be used in header
780 description files:
781
782 d_page_w page width
783
784 d_page_h page height
785
786 d_header_x header lower left x coordinate
787
788 d_header_y header lower left y coordinate
789
790 d_header_w header width
791
792 d_header_h header height
793
794 d_footer_x footer lower left x coordinate
795
796 d_footer_y footer lower left y coordinate
797
798 d_footer_w footer width
799
800 d_footer_h footer height
801
802 d_output_w width of the text output area
803
804 d_output_h height of the text output area
805
806 user_header_p predicate which tells if user has defined his/her own
807 header string: true/false
808
809 user_header_left_str
810 if user_header_p is true, this is the left field of the
811 user supplied header string.
812
813 user_header_center_str
814 if user_header_p is true, this is the center field of
815 the user supplied header string
816
817 user_header_right_str
818 if user_header_p is true, this is the right field of
819 the user supplied header string
820
821 user_footer_p predicate which tells if user has defined his/her own
822 footer string: true/false
823
824 user_footer_left_str
825 if user_footer_p is true, this is the left field of the
826 user supplied footer string.
827
828 user_footer_center_str
829 if user_footer_p is true, this is the center field of
830 the user supplied footer string
831
832 user_footer_right_str
833 if user_footer_p is true, this is the right field of
834 the user supplied footer string
835
836 HF standard header font (from -F, --header-font option).
837 This can be selected simply by invoking command: `HF
838 setfont'.
839
840 pagenum the number of the current page
841
842 fname the full name of the printed file (/foo/bar.c)
843
844 fdir the directory part of the file name (/foo)
845
846 ftail file name without the directory part (bar.c)
847
848 gs_languagelevel
849 PostScript interpreter's language level (currently 1 or
850 2)
851
852 You can also use the following special comments to customize your head‐
853 ers and to specify some extra options. Special comments are like DSC
854 comments but they start with a single `%' character; special comments
855 start from the beginning of the line and they have the following syn‐
856 tax:
857
858 %commentname: options
859
860 Currently enscript support the following special comments:
861
862 %Format: name format
863 Define a new string constant name according to the format
864 string format. Format string start from the first non-space
865 character and it ends to the end of the line. Format string
866 can contain general `%' escapes and input file related `$'
867 escapes. Currently following escapes are supported:
868
869 %% character `%'
870
871 $$ character `$'
872
873 $% current page number
874
875 $= number of pages in the current file
876
877 $p number of pages processed so far
878
879 $(VAR) value of the environment variable VAR.
880
881 %c trailing component of the current working directory
882
883 %C ($C) current time (file modification time) in `hh:mm:ss'
884 format
885
886 %d current working directory
887
888 %D ($D) current date (file modification date) in `yy-mm-dd'
889 format
890
891 %D{string} ($D{string})
892 format string string with the strftime(3) function.
893 `%D{}' refers to the current date and `$D{}' to the
894 input file's last modification date.
895
896 %E ($E) current date (file modification date) in `yy/mm/dd'
897 format
898
899 %F ($F) current date (file modification date) in `dd.mm.yyyy'
900 format
901
902 %H document title
903
904 $L number of lines in the current input file. This is
905 valid only for the toc entries, it can't be used in
906 header strings.
907
908 %m the hostname up to the first `.' character
909
910 %M the full hostname
911
912 %n the user login name
913
914 $n input file name without the directory part
915
916 %N the user's pw_gecos field up to the first `,' character
917
918 $N the full input file name
919
920 %t ($t) current time (file modification time) in 12-hour am/pm
921 format
922
923 %T ($T) current time (file modification time) in 24-hour format
924 `hh:mm'
925
926 %* ($*) current time (file modification time) in 24-hour format
927 with seconds `hh:mm:ss'
928
929 $v the sequence number of the current input file
930
931 $V the sequence number of the current input file in the
932 `Table of Contents' format: if the --toc option is
933 given, escape expands to `num-'; if the --toc is not
934 given, escape expands to an empty string.
935
936 %W ($W) current date (file modification date) in `mm/dd/yy'
937 format
938
939 All format directives except `$=' can also be given in format
940
941 escape width directive
942
943 where width specifies the width of the column to which the
944 escape is printed. For example, escape "$5%" will expand to
945 something like " 12". If the width is negative, the value will
946 be printed left-justified.
947
948 For example, the `emacs.hdr' defines its date string with the
949 following format comment:
950
951 %Format: eurdatestr %E
952
953 which expands to:
954
955 /eurdatestr (96/01/08) def
956
957 %HeaderHeight: height
958 Allocate height points space for the page header. The default
959 header height is 36 points.
960
961 %FooterHeight: height
962 Allocate height points space for the page footer. The default
963 footer height is 0 points.
964
965 According to Adobe's Document Structuring Conventions (DSC), all
966 resources needed by a document must be listed in document's prolog.
967 Since user's can create their own headers, enscript don't know what
968 resources those headers use. That's why all headers must contain a
969 standard DSC comment that lists all needed resources. For example,
970 used fonts can be listed with following comment:
971
972 %%DocumentNeededResources: font fontname1 fontname2
973
974 Comment can be continued to the next line with the standard continua‐
975 tion comment:
976
977 %%+ font fontname3
978
979
981 Enscript supports special escape sequences which can be used to add
982 some page formatting commands to ASCII documents. As a default, spe‐
983 cial escapes interpretation is off, so all ASCII files print out as
984 everyone expects. Special escapes interpretation is activated by giv‐
985 ing option -e, --escapes to enscript.
986
987 All special escapes start with the escape character. The default
988 escape character is ^@ (octal 000); escape character can be changed
989 with option -e, --escapes. Escape character is followed by escape's
990 name and optional options and arguments.
991
992 Currently enscript supports following escapes:
993
994 bgcolor change the text background color. The syntax of the escape is:
995
996 ^@bgcolor{red green blue}
997
998 where the color components red, green, and blue are given as
999 decimal numbers between values 0 and 1.
1000
1001
1002 bggray change the text background color. The syntax of the escape is:
1003
1004 ^@bggray{gray}
1005
1006 where gray is the new text background gray value. The default
1007 value is 1.0 (white).
1008
1009 color change the text color. The syntax of the escape is:
1010
1011 ^@color{red green blue}
1012
1013 where color components red, green and blue are given as decimal
1014 numbers between values 0 and 1.
1015
1016 comment comment the rest of the line including the newline character.
1017 Escape's syntax is:
1018
1019 ^@comment text newline_character
1020
1021 escape change the escape character. The syntax of the escape is:
1022
1023 ^@escape{code}
1024
1025 where code is the decimal code of the new escape character.
1026
1027 epsf inline EPS file to the document. The syntax of the escape is:
1028
1029 ^@epsf[options]{filename}
1030
1031 where options is an optional sequence of option characters and
1032 values enclosed with brackets and filename is the name of the
1033 EPS file.
1034
1035 If filename ends to the `|' character, then filename is assumed
1036 to name a command that prints EPS data to its standard output.
1037 In this case, enscript opens a pipe to the specified command
1038 and reads EPS data from pipe.
1039
1040 Following options can be given for the epsf escape:
1041
1042 c print image centered
1043
1044 r print image right justified
1045
1046 n do not update current point. Following output is
1047 printed to that position where the current point was
1048 just before the epsf escape
1049
1050 nx do not update current point x coordinate
1051
1052 ny do not update current point y coordinate
1053
1054 xnum move image's top left x coordinate num characters from
1055 current point x coordinate (relative position)
1056
1057 xnuma set image's top left x coordinate to column num (abso‐
1058 lute position)
1059
1060 ynum move image's top left y coordinate num lines from cur‐
1061 rent line (relative position)
1062
1063 ynuma set image's top left y coordinate to line num (absolute
1064 position)
1065
1066 hnum set image's height to num lines
1067
1068 snum scale image with factor num
1069
1070 sxnum scale image in x direction with factor num
1071
1072 synum scale image in y direction with factor num
1073
1074 As a default, all dimensions are given in lines (vertical) and
1075 characters (horizontal). You can also specify other units by
1076 appending an unit specifier after number. Possible unit speci‐
1077 fiers and the corresponding units are:
1078
1079 c centimeters
1080
1081 i inches
1082
1083 l lines or characters (default)
1084
1085 p PostScript points
1086
1087 For example to print an image one inch high, you can specify
1088 height by following options: h1i (1 inch), h2.54c (2.54 cm),
1089 h72p (72 points).
1090
1091 font select current font. The syntax of the escape is:
1092
1093 ^@font{fontname[:encoding]}
1094
1095 where fontname is a standard font specification. Special font
1096 specification default can be used to select the default body
1097 font (enscript's default or the one specified by the command
1098 line option -f, --font).
1099
1100 The optional argument encoding specifies the encoding that
1101 should be used for the new font. Currently the encoding can
1102 only be the enscript's global input encoding or ps.
1103
1104 ps include raw PostScript code to the output. The syntax of the
1105 escape is:
1106
1107 ^@ps{code}
1108
1109 shade highlight regions of text by changing the text background
1110 color. Escape's syntax is:
1111
1112 ^@shade{gray}
1113
1114 where gray is the new text background gray value. The default
1115 value is 1.0 (white) which disables highlighting.
1116
1117
1119 Page device is a PostScript level 2 feature that offers an uniform
1120 interface to control printer's output device. Enscript protects all
1121 page device options inside an if block so they have no effect in level
1122 1 interpreters. Although all level 2 interpreters support page device,
1123 they do not have to support all page device options. For example some
1124 printers can print in duplex mode and some can not. Refer to the docu‐
1125 mentation of your printer for supported options.
1126
1127 Here are some usable page device options which can be selected with the
1128 -D, --setpagedevice option. For a complete listing, see PostScript
1129 Language Reference Manual: section 4.11 Device Setup.
1130
1131 Collate boolean
1132 how output is organized when printing multiple copies
1133
1134 Duplex boolean
1135 duplex (two side) printing
1136
1137 ManualFeed boolean
1138 manual feed paper tray
1139
1140 OutputFaceUp boolean
1141 print output `face up' or `face down'
1142
1143 Tumble boolean
1144 how opposite sides are positioned in duplex printing
1145
1146
1148 Following printing examples assume that enscript uses the default con‐
1149 figuration. If default actions have been changed from the configura‐
1150 tion files, some examples will behave differently.
1151
1152 enscript foo.txt
1153 Print file foo.txt to the default printer.
1154
1155 enscript -Possu foo.txt
1156 Print file foo.txt to printer ossu.
1157
1158 enscript -pfoo.ps foo.txt
1159 Print file foo.txt, but leave PostScript output to file foo.ps.
1160
1161 enscript -2 foo.txt
1162 Print file foo.txt to two columns.
1163
1164 enscript -2r foo.txt
1165 Print file to two columns and rotate output 90 degrees (land‐
1166 scape).
1167
1168 enscript -DDuplex:true foo.txt
1169 Print file in duplex (two side) mode (printer dependent).
1170
1171 enscript -G2rE -U2 foo.c
1172 My default code printing command: gaudy header, two columns,
1173 landscape, code highlighting, 2-up printing.
1174
1175 enscript -E --color -whtml --toc -pfoo.html *.h *.c
1176 A nice HTML report of your project's C source files.
1177
1178
1180 The environment variable ENSCRIPT can be used to pass default options
1181 for enscript. For example, to select the default body font to be
1182 Times-Roman 7pt, set the following value to the ENSCRIPT environment
1183 variable:
1184
1185 -fTimes-Roman7
1186
1187 The value of the ENSCRIPT variable is processed before the command line
1188 options, so command line options can be used to overwrite these
1189 defaults.
1190
1191 Variable ENSCRIPT_LIBRARY specifies the enscript's library directory.
1192 It can be used to overwrite the build-in default `/usr/share/enscript'.
1193
1194
1196 Enscript returns value 1 to the shell if any errors were encountered or
1197 0 otherwise. If the option --extended-return-values was specified, the
1198 return value is constructed from the following flags:
1199
1200 0 no errors or warnings
1201
1202 2 some lines were truncated or wrapped
1203
1204 4 some characters were missing from the used fonts
1205
1206 8 some characters were unprintable
1207
1208
1210 /usr/share/enscript/*.hdr header files
1211 /usr/share/enscript/*.enc input encoding vectors
1212 /usr/share/enscript/enscript.pro PostScript prolog
1213 /usr/share/enscript/afm/*.afm AFM files for PostScript fonts
1214 /usr/share/enscript/font.map index for the AFM files
1215 /usr/share/enscript/hl/*.st states definition files
1216 /etc/enscript.cfg system-wide configuration file
1217 /etc/enscriptsite.cfg site configuration file
1218 ~/.enscriptrc personal configuration file
1219 ~/.enscript/ personal resource directory
1220
1221
1223 diffpp(1), ghostview(1), gs(1), lpq(1), lpr(1), lprm(1), states(1)
1224
1225
1227 Markku Rossi <mtr@iki.fi> <http://www.iki.fi/~mtr/>
1228
1229 GNU Enscript WWW home page: <http://www.iki.fi/~mtr/genscript/>
1230
1231
1232
1233ENSCRIPT Mar 12, 1999 ENSCRIPT(1)