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