source: trunk/third/enscript/enscript.1.in @ 17620

Revision 17620, 39.2 KB checked in by ghudson, 22 years ago (diff)
This commit was generated by cvs2svn to compensate for changes in r17619, which included commits to RCS files with non-trunk default branches.
Line 
1.\"
2.\" GNU enscript manual page.
3.\" Copyright (c) 1995-1998 Markku Rossi.
4.\" Author: Markku Rossi <mtr@iki.fi>
5.\"
6.\"
7.\" This file is part of GNU enscript.
8.\"
9.\" This program is free software; you can redistribute it and/or modify
10.\" it under the terms of the GNU General Public License as published by
11.\" the Free Software Foundation; either version 2, or (at your option)
12.\" any later version.
13.\"
14.\" This program is distributed in the hope that it will be useful,
15.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
16.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17.\" GNU General Public License for more details.
18.\"
19.\" You should have received a copy of the GNU General Public License
20.\" along with this program; see the file COPYING.  If not, write to
21.\" the Free Software Foundation, 59 Temple Place - Suite 330,
22.\" Boston, MA 02111-1307, USA.
23.\"
24.TH ENSCRIPT 1 "Jun 25, 1998" "ENSCRIPT" "ENSCRIPT"
25
26.SH NAME
27enscript \- convert text files to PostScript
28
29.SH SYNOPSIS
30.B enscript
31[\f3\-12BcgGhjkKlmOqrRvVzZ\f1]
32[\f3\-# \f2copies\f1]
33[\f3\-a \f2pages\f1]
34[\f3\-A \f2align\f1]
35[\f3\-b \f2header\f1]
36[\f3\-C\f1[\f2start_line\f1]]
37[\f3\-d \f2printer\f1]
38[\f3\-D \f2key\f1[\f3:\f2value\f1]]
39[\f3\-e\f1[\f2char\f1]]
40[\f3\-E\f1[\f2lang\f1]]
41[\f3\-f \f2font\f1]
42[\f3\-F \f2header_font\f1]
43[\f3\-H\f1[\f2num\f1]]
44[\f3\-i \f2indent\f1]
45[\f3\-I \f2filter\f1]
46[\f3\-J \f2title\f1]
47[\f3\-L \f2lines_per_page\f1]
48[\f3\-M \f2media\f1]
49[\f3\-n \f2copies\f1]
50[\f3\-N \f2newline\f1]
51[\f3\-o \f2outputfile\f1]
52[\f3\-o \-\f1]
53[\f3\-p \f2outputfile\f1]
54[\f3\-p \-\f1]
55[\f3\-P \f2printer\f1]
56[\f3\-s \f2baselineskip\f1]
57[\f3\-S \f2key\f1[\f3:\f2value\f1]]
58[\f3\-t \f2title\f1]
59[\f3\-T \f2tabsize\f1]
60[\f3\-u\f1[\f2text\f1]]
61[\f3\-U \f2num\f1]
62[\f3\-W \f2language\f1]
63[\f3\-X \f2encoding\f1]
64[\f2filename\f1 ...]
65
66.SH DESCRIPTION
67
68\f3Enscript\f1 converts text files to PostScript and spools generated
69PostScript output to the specified printer or leaves it to file.  If
70no input files are given, \f3enscript\f1 processes standard input.
71\f3Enscript\f1 can be extended to handle different output media and it
72has many options which can be used to customize printouts.
73
74.SH OPTIONS
75.TP 8
76.B \-# \f2num\f3
77Print \f2num\f1 copies of each page.
78.TP 8
79.B \-1, \-2, \-\-columns=\f2num\f3
80Specify how many columns each page have.  With long option
81\f3\-\-columns=\f2num\f1 you can specify more than 2 columns per page.
82.TP 8
83.B \-a \f2pages\f3, \-\-pages=\f2pages\f3
84Specify which pages are printed.  Page specification \f2pages\f1 can
85be given in following formats:
86.RS 8
87.TP 8
88\f2begin\f1\-\f2end\f1
89print pages from \f2begin\f1 to \f2end\f1
90.TP 8
91\-\f2end\f1
92print pages from 0 to \f2end\f1
93.TP 8
94\f2begin\f1\-
95print pages from \f2begin\f1 to end
96.TP 8
97\f2page\f1
98print page \f2page\f1
99.TP 8
100odd
101print odd pages
102.TP 8
103even
104print even pages
105.RE
106.TP 8
107.B \-A \f2align\f3, \-\-file\-align=\f2align\f3
108Align separate input files to even \f2align\f1 page count.  This is
109handy for two-side and 2-up printings (\-\-file\-align=2).
110.TP 8
111.B \-b \f2header\f3, \-\-header=\f2header\f3
112Use text \f2header\f1 as a page header.  The default page header is
113constructed from file's name and last modification time.
114
115The header string \f2header\f1 can contain the same formatting escapes
116which can be specified for the \f3%Format\f1 directives in the user
117defined fancy headers.  For example, the following option prints the
118file name, current data and page numbers:
119
120\f3enscript --header='$n %W Page $% of $=' *.c\f1
121
122The header string can also contain left, center and right justified
123fields which are separated with the \f3'|'\f1 character:
124
125\f3enscript --header='$n|%W|Page $% of $=' *.c\f1
126
127now the file name is printed left justified, the date is centered to
128the header and the page numbers are printed right justified.
129.TP 8
130.B \-B, \-\-no\-header
131Do not print page headers.
132.TP 8
133.B \-c, \-\-truncate\-lines
134Cut lines that are too long.  As a default, \f3enscript\f1 wraps long
135lines so no information is lost.
136
137See also option \f3\-\-slice\f1 which can be used to slice long lines
138to separate pages.
139.TP 8
140.B \-C\f1[\f2start_line\f1]\f3, \-\-line\-numbers\f1[\f3=\f2start_line\f1]\f3
141Precede each line with its line number.  Optional argument
142\f2start_line\f1 specifies the number of the first line in the input.
143The number of the first line defaults to 1.
144.TP 8
145.B \-d \f2name\f3
146Spool output to the printer \f2name\f1.
147.TP 8
148.B \-D \f2key\f1[\f3:\f2value\f1]\f3, \-\-setpagedevice=\f2key\f1[\f3:\f2value\f1]\f3
149Pass a page device definition to the generated PostScript output.  If
150no value is given, key \f2key\f1 is removed from definitions.
151
152For example, command
153
154.B enscript \-DDuplex:true foo.txt
155
156prints file foo.txt in duplex (two side) mode.
157
158Page device operators are implementation dependant but they are
159standardized.  See section \f3PAGE DEVICE OPTIONS\f1 for details.
160.TP 8
161.B \-e\f1[\f2char\f1]\f3, \-\-escapes\f1[\f3=\f2char\f1]\f3
162Enable special escapes interpretation (see section \f3SPECIAL
163ESCAPES\f1).  If argument \f2char\f1 is given, it changes the escape
164character to \f2char\f1.  The default escape character is 0.
165.TP 8
166.B \-E\f1[\f2lang\f1]\f3, \-\-pretty\-print\f1[\f3=\f2lang\f1]\f3
167Pretty-print source code by creating a special input filter with the
168\f3states\f1 program.  Optional argument \f2lang\f1 specifies the
169language to highlight, as a default \f3states\f1 makes an educated
170guess.
171
172A description of supported highlighting languages and file formats can
173be printed with command:
174
175.B enscript \-\-help\-pretty\-print
176
177The highlighting rules are defined in the
178`@prefix@/share/enscript/enscript.st' file which can be edited to
179create highlighting definitions for new languages.
180
181\f3Note!\f1 You can't use your own input filters with this
182option.
183.TP 8
184.B \-f \f2name\f3, \-\-font=\f2name\f3
185Select font that is used for body text.  The default body font is
186\f2Courier10\f1, unless multicolumn landscape printing mode is
187selected, in which case the default is \f2Courier7\f1.
188
189Font specification \f2name\f1 contains two parts: font's name and
190font's size in points.  For example "\f3Times\-Roman12\f1" selects
191"Times\-Roman" font with size 12pt.
192
193The font specification \f2name\f1 can also be given in format
194`\f2name\f1@\f2ptsize\f1', where font's name and point size are
195separated by a `@' character.  This allows \f3enscript\f1 to use
196fonts which contain digit characters in their names.
197
198The font point size can also be given in format
199\f2width\f1/\f2height\f1 where \f2width\f1 and \f2height\f1 specify
200the font's size in x- and y-directions.  For example
201"\f3Times\-Roman@10/12\f1" selects 10 points wide and 12 points high
202"Times\-Roman" font.
203
204\f3Note!\f1 font sizes can be given as a decimal number.  For example
205"\f3Times\-Roman10.2\f1" selects 10.2pt "Times\-Roman" font.
206.TP 8
207.B \-F \f2name\f3, \-\-header\-font=\f2name\f3
208Select font for header texts.
209.TP 8
210.B \-g, \-\-print\-anyway
211Print file even if it contains binary data.  Option is here only for
212compatibility since \f3enscript\f1 prints binary files anyway.
213.TP 8
214.B \-G, \-\-fancy\-header\f1[\f3=\f2name\f1]\f3
215Print fancy page header \f2name\f1 to top of each page.  Option
216\f3\-G\f1 specifies the default fancy header (see section
217\f3CONFIGURATION FILES\f1 to see how the default fancy header can be
218changed).
219.TP 8
220.B \-h, \-\-no\-job\-header
221Suppress printing of the job header page.
222.TP 8
223.B \-H\f1[\f2num\f1]\f3, \-\-highlight\-bars\f1[\f3=\f2num\f1]\f3
224Specify how high highlight bars are in lines.  If \f2num\f1 is not
225given, the default value 2 is used.  As a default, no highlight bars
226are printed.
227.TP 8
228.B \-i \f2num\f3, \-\-indent=\f2num\f3
229Indent every line \f2num\f1 characters.  The indentation can also be
230specified in other units by appending an unit specifier after the
231number.  Possible unit specifiers and the corresponding units are:
232.RS 8
233.TP 8
234.B c
235centimeters
236.TP 8
237.B i
238inches
239.TP 8
240.B l
241characters (default)
242.TP 8
243.B p
244PostScript points
245.RE
246.TP 8
247.B \-I \f2filter\f3, \-\-filter=\f2filter\f1
248Read all input files through input filter \f2filter\f1.  Input filter
249can be a single command or a command pipeline and it can refer to the
250name of the input file with escape `%s'.  The name of the input file
251\f3stdin\f1 can be changed with option `\f3\-\-filter\-stdin\f1'.
252
253For example, the following command can be used to print file `foo.c'
254by using only upper-case characters:
255
256enscript --filter="cat %s | tr 'a-z' 'A-Z'" foo.c
257
258And to highlight changes made to files since the last checkout:
259
260enscript --filter="rcsdiff %s | diffpp %s" -e *.c
261
262\f3Note!\f1 To include string "%s" to the filter command, you must
263write it as "%%s".
264.TP 8
265.B \-j, \-\-borders
266Print borders around columns.
267.TP 8
268.B \-J \f2title\f3
269An alias for option \f3\-t\f1, \f3\-\-title\f1.
270.TP 8
271.B \-k, \-\-page\-prefeed
272Enable page prefeed.
273.TP 8
274.B \-K, \-\-no\-page\-prefeed
275Disable page prefeed (default).
276.TP 8
277.B \-l, \-\-lineprinter
278Emulate lineprinter.  This option is a shortcut for options:
279\f3\-\-lines\-per\-page=66\f1, \f3\-\-no\-header\f1.
280.TP 8
281.B \-L \f2num\f3, \-\-lines\-per\-page=\f2num\f3
282Print only \f2num\f1 lines per each page.
283.TP 8
284.B \-m, \-\-mail
285Send mail notification to user after print job has been completed.
286.TP 8
287.B \-M \f2name\f3, \-\-media=\f2name\f3
288Select output media \f2name\f1.  \f3Enscript\f1's default output
289media is \f3@MEDIA@\f1.
290.TP 8
291.B \-n \f2num\f3, \-\-copies=\f2num\f3
292Print \f2num\f1 copies of each page.
293.TP 8
294.B \-N \f2nl\f3, \-\-newline=\f2nl\f3
295Select the \f2newline\f1 character.  Possible values for \f2nl\f1 are:
296\f3n\f1 (unix newline, 0xa hex) and \f3r\f1 (mac newline, 0xd hex).
297.TP 8
298.B \-o \f2file\f3
299An alias for option \f3\-p\f1, \f3\-\-output\f1.
300.TP 8
301.B \-O, \-\-missing\-characters
302Print a listing of character codes which couldn't be printed.
303.TP 8
304.B \-p \f2file\f3, \-\-output=\f2file\f3
305Leave output to file \f2file\f1.  If \f2file\f1 is `\-', leave output
306to \f2stdout\f1.
307.TP 8
308.B \-P \f2name\f3, \-\-printer=\f2name\f3
309Spool output to the printer \f2name\f1.
310.TP 8
311.B \-q, \-\-quiet, \-\-silent
312Make \f3enscript\f1 really quiet.  Only fatal error messages are
313printed to \f2stderr\f1.
314.TP 8
315.B \-r, \-\-landscape
316Print in landscape mode; rotate page 90 degrees.
317.TP 8
318.B \-R, \-\-portrait
319Print in portrait mode (default).
320.TP 8
321.B \-s \f2num\f3, \-\-baselineskip=\f2num\f3
322Specify the baseline skip in PostScript points.  Number \f2num\f1 can
323be given as a decimal number.  When \f3enscript\f1 moves from line to
324line, current point \f2y\f1 coordinate is moved (\f2font point size +
325baselineskip\f1) points down.  The default baseline skip is 1.
326.TP 8
327.B \-S \f2key\f1[\f3:\f2value\f1]\f3, \-\-statusdict=\f2key\f1[\f3:\f2value\f1]\f3
328Pass a statusdict definition to the generated PostScript output.  If
329no value is given, key \f2key\f1 is removed from definitions.
330
331Statusdict operators are implementation dependant; see printer's
332documentation for details.
333
334For example, command
335
336.B enscript \-Ssetpapertray:1 foo.txt
337
338prints file \f2foo.txt\f1 by using paper from the paper tray 1
339(assuming that printer supports paper tray selection).
340.TP 8
341.B \-t \f2title\f3, \-\-title=\f2title\f3
342Set banner page's job title to \f2title\f1.  Option sets also the name
343of the input file \f3stdin\f1.
344.TP 8
345.B \-T \f2num\f3, \-\-tabsize=\f2num\f3
346Set tabulator size to \f2num\f1 (default is 8).
347.TP 8
348.B \-u\f1[\f2text\f1]\f3, \-\-underlay\f1[\f3=\f2text\f1]\f3
349Print string \f2text\f1 under every page.  Text's properties can be
350changed with options \f3\-\-ul\-angle\f1, \f3\-\-ul\-font\f1,
351\f3\-\-ul\-gray\f1, \f3\-\-ul\-position\f1 and \f3\-\-ul\-style\f1.
352
353If no \f2text\f1 is given, no underlay is printed.  This can be used
354to remove underlay that was specified with the `\f3Underlay\f1'
355configuration file option.
356.TP 8
357.B \-U \f2num\f3, \-\-nup=\f2num\f3
358Print \f2num\f1 logical pages on each output page (N-up printing).
359.TP 8
360.B \-v, \-\-verbose\f1[\f3=\f2level\f1]\f3
361Tell what \f3enscript\f1 is doing.
362.TP 8
363.B \-V, \-\-version
364Print \f3enscript\f1 version and exit.
365.TP 8
366.B \-W \f1[\f2lang\f1]\f3, \-\-language\f1[\f3=\f2lang\f1]\f3
367Generate output in language \f2lang\f1.  Possible values for
368\f2lang\f1 are:
369.RS 8
370.TP 8
371.B PostScript
372generate PostScript (default)
373.TP 8
374.B html
375generate HTML
376.TP 8
377.B overstrike
378generate overstrikes (line printers, less)
379.TP 8
380.B rtf
381generate RTF (Rich Text Format)
382.RE
383.TP 8
384.B \-X \f2name\f3, \-\-encoding=\f2name\f3
385Use input encoding \f2name\f1.  Currently \f3enscript\f1 supports
386following encodings:
387.RS 8
388.TP 8
389.B 88591, latin1
390ISO\-8859\-1 (ISO Latin1) (\f3enscript\f1's default encoding).
391.TP 8
392.B 88592, latin2
393ISO\-8859\-2 (ISO Latin2)
394.TP 8
395.B 88593, latin3
396ISO\-8859\-3 (ISO Latin3)
397.TP 8
398.B 88594, latin4
399ISO\-8859\-4 (ISO Latin4)
400.TP 8
401.B 88595, cyrillic
402ISO\-8859\-5 (ISO Cyrillic)
403.TP 8
404.B 88597, greek
405ISO\-8859\-7 (ISO Greek)
406.TP 8
407.B ascii
4087\-bit ascii
409.TP 8
410.B asciifise, asciifi, asciise
4117\-bit ascii with some scandinavian (fi, se) extensions
412.TP 8
413.B asciidkno, asciidk, asciino
4147\-bit ascii with some scandinavian (dk, no) extensions
415.TP 8
416.B ibmpc, pc, dos
417IBM PC charset
418.TP 8
419.B mac
420Mac charset
421.TP 8
422.B vms
423VMS multinational charset
424.TP 8
425.B hp8
426HP Roman-8 charset
427.TP 8
428.B koi8
429Adobe Standard Cyrillic Font KOI8 charset
430.TP 8
431.B ps, PS
432PostScript font's default encoding
433.TP 8
434.B pslatin1, ISOLatin1Encoding
435PostScript interpreter's `ISOLatin1Encoding'
436.RE
437.TP 8
438.B \-z, \-\-no\-formfeed
439Turn off form feed character interpretation.
440.TP 8
441.B \-Z, \-\-pass\-through
442Pass through all PostScript and PCL files without any modifications.
443This allows that \f3enscript\f1 can be used as a lp filter.
444
445PostScript files are recognized by looking up the `%!' magic cookie
446from the beginning of the file. \f3Note!\f1 \f3Enscript\f1 recognized
447also the Windoze damaged `^D%!' cookie.
448
449PCL files are recognized by looking up the `^[E' or `^[%' magic
450cookies from the beginning of the file.
451.TP 8
452.B \-\-color\f1[\f3=\f2color\f1]\f3
453Set the pretty-printing color model to \f2color\f1.  If no \f2color\f1
454is specified, use color model \f3emacs\f1.
455.TP 8
456.B \-\-download\-font=\f2fontname\f3
457Include the font description file (\f2.pfa\f1 or \f2.pfb\f1 file) of
458the font \f2fontname\f1 to the generated output.
459.TP 8
460.B \-\-filter\-stdin=\f2name\f1
461Specify how \f3stdin\f1 is shown to the input filter.  The default
462value is an empty string ("") but some programs require that
463\f3stdin\f1 is called something else, usually "-".
464.TP 8
465.B \-\-h\-column\-height=\f2height\f3
466Set the horizontal column height to be \f2height\f1 PostScript
467points.  The option sets the formfeed type to
468\f2horizontal\-columns\f1.
469.TP 8
470.B \-\-help
471Print short help message and exit.
472.TP 8
473.B \-\-help\-pretty\-print
474Describe all supported \f3\-\-pretty\-print\f1 languages and file
475formats.
476.TP 8
477.B \-\-highlight\-bar\-gray=\f2gray\f3
478Specify the gray level which is used to print highlight bars.
479.TP 8
480.B \-\-list\-media
481List the names of all known output media and exit successfully.
482.TP 8
483.B \-\-list\-options
484List all options and their current values.  Exit successfully.
485.TP 8
486.B \-\-margins=\f2left\f3:\f2right\f3:\f2top\f3:\f2bottom\f3
487Adjust page marginals to be exact \f2left\f1, \f2right\f1, \f2top\f1
488and \f2bottom\f1 PostScript points.  Any of arguments can be left
489empty in which case the default value is used.
490.TP 8
491.B \-\-mark\-wrapped\-lines\f1[\f3=\f2style\f1]\f3
492Mark wrapped lines in the output with style \f2style\f1.  Possible
493values for \f2style\f3 are:
494.RS 8
495.TP 8
496.B none
497do not mark them (default)
498.TP 8
499.B plus
500print a plus (+) character to the end of each wrapped line
501.TP 8
502.B box
503print a black box to the end of each wrapped line
504.TP 8
505.B arrow
506print a small arrow to the end of each wrapped line
507.RE
508.TP 8
509.B \-\-non\-printable\-format=\f2format\f3
510Specify how non-printable characters are printed.  Possible values for
511\f2format\f3 are:
512.RS 8
513.TP 8
514.B caret
515caret notation: `^@', `^A', `^B', ...
516.TP 8
517.B octal
518octal notation: `\\000', `\\001', `\\002', ... (default)
519.TP 8
520.B questionmark
521replace non-printable characters with a question mark `?'
522.TP 8
523.B space
524replace non-printable characters with a space ` '
525.RE
526.TP 8
527.B \-\-nup\-xpad=\f2num\f3
528Set the page x-padding of the \f2n\f1-up printing to \f2num\f1
529PostScript points.  The default is 10 points.
530.TP 8
531.B \-\-nup\-ypad=\f2num\f3
532Set the page y-padding of the \f2n\f1-up printing to \f2num\f1
533PostScript points.  The default is 10 points.
534.TP 8
535.B \-\-page\-label\-format=\f2format\f3
536Set page label format to \f2format\f1.  Page label format specifies
537how labels for the `%%Page:' PostScript comments are formatted.
538Possible values are:
539.RS 8
540.TP 8
541.B short
542Print current pagenumber: `%%Page: (1) 1' (default)
543.TP 8
544.B long
545Print current filename and pagenumber: `%%Page: (main.c:  1) 1'
546.RE
547.TP 8
548.B \-\-ps\-level=\f2level\f3
549Set the PostScript language level, that \f3enscript\f1 uses for its
550output, to \f2level\f1.  The possible values are \f31\f1, and
551\f32\f1.
552.TP 8
553.B \-\-printer\-options=\f2options\f3
554Pass extra options to the printer command.
555.TP 8
556.B \-\-rotate\-even\-pages
557Rotate each even-numbered page 180 degrees.
558.TP 8
559.B \-\-slice=\f2num\f3
560Print vertical slice \f2num\f1.  Slices are vertical regions of input
561files, new slice starts from the point where the line would otherwise
562be wrapped to the next line.  Slice numbers start from 1.
563.TP 8
564.B \-\-toc
565Print table of contents to the end of the print job.
566.TP 8
567.B \-\-word\-wrap
568Wrap long lines from word boundaries.
569.TP 8
570.B \-\-ul\-angle=\f2angle\f3
571Set underlay text's angle.  As a default, angle is atan(-page_height,
572page_width).
573.TP 8
574.B \-\-ul\-font=\f2name\f3
575Select font for the underlay text.  The default underlay font is
576\f2Times-Roman200\f1.
577.TP 8
578.B \-\-ul\-gray=\f2num\f3
579Print underlay text with gray value \f2num\f1 (0 ... 1), the default
580gray is .8.
581.TP 8
582.B \-\-ul\-position=\f2position_spec\f3
583Set underlay text's starting position according to
584\f2position_spec\f1.  Position specification must be given in format:
585`\f2sign\f1 \f2xpos\f1 \f2sign\f1 \f2ypos\f1', where \f2sign\f1 must
586be `+' or `-'.  Positive dimensions are measured from the lower left
587corner and negative dimensions from the upper right corner.  For
588example, spec `+0-0' specifies the upper left corner and `-0+0'
589specifies the lower right corner.
590.TP 8
591.B \-\-ul\-style=\f2style\f3
592Set underlay text's style to \f2style\f1.  Possible values for
593\f2style\f1 are:
594.RS 8
595.TP 8
596.B outline
597print outline underlay texts (default)
598.TP 8
599.B filled
600print filled underlay texts
601.RE
602
603.SH CONFIGURATION FILES
604
605.B Enscript
606reads configuration information from following sources (in this
607order): command line options, environment variable \f3ENSCRIPT\f1,
608user's personal configuration file (\f3$HOME/.enscriptrc\f1), site
609configuration file (\f3@prefix@/etc/enscriptsite.cfg\f1) and system's
610global configuration file (\f3@prefix@/etc/enscript.cfg\f1).
611
612The configuration files have the following format:
613
614Empty lines and lines starting with `#' are comments.
615
616All other lines are option lines and have format:
617
618\f2OPTION\f1 [\f2arguments ...\f1].
619
620Following options can be specified:
621.TP 8
622.B AcceptCompositeCharacters: \f2bool\f1
623Specify whatever PostScript font's composite characters are accepted
624as printable or should they be considered as non-existent.  The
625default value is false (0).
626.TP 8
627.B AFMPath: \f2path\f3
628Specifies search path for the \f2AFM\f1 files.
629.TP 8
630.B AppendCtrlD: \f2bool\f3
631Specify if the Control-D (^D) character should be appended to the end
632of the output.  The default value is false (0).
633.TP 8
634.B Clean7Bit: \f2bool\f3
635Specify how characters greater than 127 are printed.  Value true (1)
636generates 7-bit clean code by escaping all characters greater than 127
637to the backslash-octal notation (default).  Value false (0) generates
6388-bit PostScript code leaving all characters untouched.
639.TP 8
640.B DefaultEncoding: \f2name\f3
641Select the default input encoding.  Encoding name \f2name\f1 can be
642one of the values of the \f3\-X\f1, \f3\-\-encoding\f1 option.
643.TP 8
644.B DefaultFancyHeader: \f2name\f3
645Select the default fancy header.  Default header is used when option
646\f3\-G\f1 is specified or option \f3\-\-fancy\-header\f1 is given without
647an argument.  System\-wide default is `\f3enscript\f1'.
648.TP 8
649.B DefaultMedia: \f2name\f3
650Select the default output media.
651.TP 8
652.B DefaultOutputMethod: \f2method\f3
653Select the default target to which generated output is send.  Possible
654values for \f2method\f1 are:
655.RS 8
656.TP 8
657.B printer
658send output to printer (default)
659.TP 8
660.B stdout
661send output to \f2stdout\f1
662.RE
663.TP 8
664.B DownloadFont: \f2fontname\f3
665Include the font description file of the font \f2fontname\f1 to the
666generated output.
667.TP 8
668.B EscapeChar: \f2num\f3
669Specify the escape character for special escapes.  The default value
670is 0.
671.TP 8
672.B FormFeedType: \f2type\f3
673Specify what to do when a formfeed character is encountered from the
674input.  Possible values for \f2type\f1 are:
675.RS 8
676.TP 8
677.B column
678move to the beginning of the next column (default)
679.TP 8
680.B page
681move to the beginning of the next page
682.RE
683.TP 8
684.B GeneratePageSize: \f2bool\f3
685Specify whether the \f3PageSize\f1 page device setting is generated to
686the PostScript output.  The default value is true (1).
687.TP 8
688.B HighlightBarGray: \f2gray\f3
689Specify the gray level which is used to print highlight bars.
690.TP 8
691.B HighlightBars: \f2num\f3
692Specify how high highlight bars are in lines.  The default value is 0
693so no highlight bars are printed.
694.TP 8
695.B LibraryPath: \f2path\f3
696Specifies \f3enscript\f1's library path that is used to lookup
697various resources.  Default path is:
698`@prefix@/share/enscript:\f2home\f1/.enscript'.  Where \f2home\f1 is
699the user's home directory.
700.TP 8
701.B MarkWrappedLines: \f2style\f3
702Mark wraped lines in the output with style \f2style\f1.  Possible
703values for \f2format\f1 are the same which can be given for the
704\f3\-\-mark\-wrapped\-lines\f1 option.
705.TP 8
706\f3Media: \f2name\f3 \f2width\f3 \f2height\f3 \f2llx\f3 \f2lly\f3 \f2urx\f3 \f2ury\f3
707Add a new output media with name \f2name\f1.  Media's physical
708dimensions are \f2width\f1 and \f2height\f1.  Media's bounding box is
709specified by points (\f2llx\f1, \f2lly\f1) and (\f2urx\f1, \f2ury\f1).
710.B Enscript
711prints all graphics inside media's bounding box.
712
713User can select this media by giving option \f3\-M \f2name\f1.
714.TP 8
715.B NoJobHeaderSwitch: \f2switch\f1
716Specify the spooler option to suppress the print job header.  This
717option is passed to the printer spooler when \f3enscript\f1's option
718\f3\-h\f1, \f3\-\-no\-job\-header\f1 is selected.
719.TP 8
720.B NonPrintableFormat: \f2format\f1
721Specify how non-printable characters are printed.  Possible values for
722\f2format\f1 are the same which can be given for the
723\f3\-\-non\-printable\-format\f1 option.
724.TP 8
725.B OutputFirstLine: \f2line\f1
726Set PostScript output's first line to \f2line\f1, the default value
727is \f3PS-Adobe-3.0\f1.  Since some printers do not like DSC levels
728greater than 2.0, this option can be used to change the output first
729line to something more suitable like \f3%!PS-Adobe-2.0\f1 or
730\f3%!\f1.
731.TP 8
732.B PageLabelFormat: \f2format\f1
733Set page label format to \f2format\f1.  Possible values for
734\f2format\f1 are the same which can be given for the
735\f3\-\-page\-label\-format\f1 option.
736.TP 8
737.B PagePrefeed: \f2bool\f3
738Enable / disable page prefeed.  The default is false (0).
739.TP 8
740.B PostScriptLevel: \f2level\f3
741Set the PostScript language level, that \f3enscript\f1 uses for its
742output, to \f2level\f1.  The possible values for \f2level\f1 are the
743same which can be given for the \f3\-\-ps\-level\f1 option.
744.TP 8
745.B Printer: \f2name\f3
746Names the printer to spool to.
747.TP 8
748.B QueueParam: \f2name\f3
749The spooler command switch for the printer queue, e.g. \f2\-P\f1 in
750\f2lpr \-Pps\f1.  This option can also be used to pass other flags to
751the spooler command but they must be given before the queue switch.
752.TP 8
753.B SetPageDevice: \f2key\f1[\f3:\f2value\f1]\f3
754Pass a page device definition to the generated PostScript output.
755.TP 8
756.B Spooler: \f2name\f3
757Names printer spooler command.  \f3Enscript\f1 pipes generated
758PostScript to command \f2name\f1.
759.TP 8
760.B StatesColorModel: \f2model\f3
761Set the pretty-printing color model to \f2model\f1.  Possible values
762are \f3blackwhite\f1 and \f3emacs\f1.
763.TP 8
764.B StatesConfigFile: \f2file\f3
765Read pretty-printer states configuration from file \f2file\f1.  The
766default config file is `@prefix@/share/enscript/enscript.st'.
767.TP 8
768.B StatesHighlightLevel: \f2level\f3
769Set the pretty-printing highlight level to \f2level\f1.  Possible
770values are \f3none\f1, \f3light\f1 and \f3heavy\f1.
771.TP 8
772.B StatesPath: \f2path\f3
773Define path for the \f3states\f1 program.
774.TP 8
775.B StatusDict: \f2key\f1[\f3:\f2value\f1]\f3
776Pass a statusdict definition to the generated PostScript output.
777.TP 8
778.B TOCFormat: \f2format\f3
779Format table of contents entries with format string \f2format\f1.
780Format string \f2format\f1 can contain the same escapes which are used
781to format header strings with the `%Format' special comment.
782.TP 8
783.B Underlay: \f2text\f3
784Print string \f2text\f1 under every page.
785.TP 8
786.B UnderlayAngle: \f2num\f3
787Set underlay text's angle to \f2num\f1.
788.TP 8
789.B UnderlayFont: \f2fontspec\f3
790Select font for the underlay text.
791.TP 8
792.B UnderlayGray: \f2num\f3
793Print underlay text with gray value \f2num\f1.
794.TP 8
795.B UnderlayPosition: \f2position_spec\f3
796Set underlay text's starting position according to
797\f2position_spec\f1.
798.TP 8
799.B UnderlayStyle: \f2style\f3
800Set underlay text's style to \f2style\f1.
801
802.SH CUSTOMIZATION
803
804Users can create their own fancy headers by creating a header
805description file and placing it in a directory which is in
806\f3enscript\f1's library path.  The name of the header file must be in
807format: `\f2headername\f1.hdr'.  Header can be selected by giving
808option: \f3\-\-fancy\-header=\f2headername\f1.
809
810Header description file contains PostScript code that paints the
811header.  Description file must provide procedure \f3do_header\f1 which
812is called by \f3enscript\f1 at the beginning of every page.
813
814Header description file contains two parts: comments and code.  Parts
815are separated by a line containing text:
816
817% \-\- code follows this line \-\-
818
819.B Enscript
820copies only the code part of description file to the generated
821PostScript output.  The comments part can contain any data, it is not
822copied.  If separator line is missing, no data is copied to output.
823
824.B Enscript
825defines following constants which can be used in header description
826files:
827.TP 16
828.B  d_page_w
829page width
830.TP 16
831.B  d_page_h
832page height
833.TP 16
834.B  d_header_x
835header lower left \f2x\f1 coordinate
836.TP 16
837.B  d_header_y
838header lower left \f2y\f1 coordinate
839.TP 16
840.B  d_header_w
841header width
842.TP 16
843.B  d_header_h
844header height
845.TP 16
846.B d_footer_x
847footer lower left \f2x\f1 coordinate
848.TP 16
849.B d_footer_y
850footer lower left \f2y\f1 coordinate
851.TP 16
852.B d_footer_w
853footer width
854.TP 16
855.B d_footer_h
856footer height
857.TP 16
858.B  d_output_w
859width of the text output area
860.TP 16
861.B  d_output_h
862height of the text output area
863.TP 16
864.B  user_header_p
865predicate which tells if user has defined his/her own header string:
866\f3true\f1/\f3false\f1
867.TP 16
868.B  user_header_left_str
869if \f3user_header_p\f1 is \f3true\f1, this is the left field of the
870user supplied header string.
871.TP 16
872.B user_header_center_str
873if \f3user_header_p\f1 is \f3true\f1, this is the center field of the
874user supplied header string
875.TP 16
876.B user_header_right_str
877if \f3user_header_p\f1 is \f3true\f1, this is the right field of the
878user supplied header string
879.TP 16
880.B  HF
881standard header font (from \f3\-F\f1, \f3\-\-header\-font\f1 option).
882This can be selected simply by invoking command: `\f3HF setfont\f1'.
883.TP 16
884.B pagenum
885the number of the current page
886.TP 16
887.B fname
888the full name of the printed file (/foo/bar.c)
889.TP 16
890.B fdir
891the directory part of the file name (/foo)
892.TP 16
893.B ftail
894file name without the directory part (bar.c)
895.TP 16
896.B gs_languagelevel
897PostScript interpreter's language level (currently 1 or 2)
898.P
899
900You can also use the following special comments to customize your
901headers and to specify some extra options.  Special comments are like
902DSC comments but they start with a single `%' character; special
903comments start from the beginning of the line and they have the
904following syntax:
905
906%\f2commentname\f1: \f2options\f1
907
908Currently \f3enscript\f1 support the following special comments:
909.TP 8
910.B %Format: \f2name\f3 \f2format\f3
911Define a new string constant \f2name\f1 according to the format string
912\f2format\f1.  Format string start from the first non-space character
913and it ends to the end of the line.  Format string can contain general
914`%' escapes and input file related `$' escapes.  Currently following
915escapes are supported:
916.RS 8
917.TP 8
918.B %%
919character `%'
920.TP 8
921.B $$
922character `$'
923.TP 8
924.B $%
925current page number
926.TP 8
927.B $=
928number of pages in the current file
929.TP 8
930.B $(\f2VAR\f3)
931value of the environment variable \f2VAR\f1.
932.TP 8
933.B %c
934trailing component of the current working directory
935.TP 8
936.B %C \f1(\f3$C\f1)\f3
937current time (file modification time) in `hh:mm:ss' format
938.TP 8
939.B %d
940current working directory
941.TP 8
942.B %D \f1(\f3$D\f1)\f3
943current date (file modification date) in `yy-mm-dd' format
944.TP 8
945.B %D{\f2string\f3} \f1(\f3$D{\f2string\f3}\f1)\f3
946format string \f2string\f1 with the strftime(3) function.
947`\f3%D{}\f1' refers to the current date and `\f3$D{}\f1' to the input
948file's last modification date.
949.TP 8
950.B %E \f1(\f3$E\f1)\f3
951current date (file modification date) in `yy/mm/dd' format
952.TP 8
953.B %F \f1(\f3$F\f1)\f3
954current date (file modification date) in `dd.mm.yyyy' format
955.TP 8
956.B %H
957document title
958.TP 8
959.B $L
960number of lines in the current input file.  This is valid only for the
961toc entries, it can't be used in header strings.
962.TP 8
963.B %m
964the hostname up to the first `.' character
965.TP 8
966.B %M
967the full hostname
968.TP 8
969.B %n
970the user login name
971.TP 8
972.B $n
973input file name without the directory part
974.TP 8
975.B %N
976the user's pw_gecos field up to the first `,' character
977.TP 8
978.B $N
979the full input file name
980.TP 8
981.B %t \f1(\f3$t\f1)\f3
982current time (file modification time) in 12-hour am/pm format
983.TP 8
984.B %T \f1(\f3$T\f1)\f3
985current time (file modification time) in 24-hour format `hh:mm'
986.TP 8
987.B %* \f1(\f3$*\f1)\f3
988current time (file modification time) in 24-hour format with seconds
989`hh:mm:ss'
990.TP 8
991.B $v
992the sequence number of the current input file
993.TP 8
994.B $V
995the sequence number of the current input file in the `Table of
996Contents' format: if the \f3\-\-toc\f1 option is given, escape expands
997to `\f2num\f1\-'; if the \f3\-\-toc\f1 is not given, escape expands to
998an empty string.
999.TP 8
1000.B %W \f1(\f3$W\f1)\f3
1001current date (file modification date) in `mm/dd/yy' format
1002.RE
1003
1004.RS 8
1005All format directives except `$=' can also be given in format
1006
1007\f2escape\f1 \f2width\f1 \f2directive\f1
1008
1009where \f2width\f1 specifies the width of the column to which the
1010escape is printed.  For example, escape "$5%" will expand to something
1011like " 12".  If the width is negative, the value will be printed
1012left-justified.
1013
1014For example, the `emacs.hdr' defines its date string with the
1015following format comment:
1016
1017.B %Format: eurdatestr %E
1018
1019which expands to:
1020
1021.B /eurdatestr (96/01/08) def
1022.RE
1023.P
1024.TP 8
1025.B %HeaderHeight: \f2height\f1
1026Allocate \f2height\f1 points space for the page header.  The default
1027header height is 36 points.
1028.TP 8
1029.B %FooterHeight: \f2height\f1
1030Allocate \f2height\f1 points space for the page footer.  The default
1031footer height is 0 points.
1032.P
1033
1034According to Adobe's Document Structuring Conventions (DSC), all
1035resources needed by a document must be listed in document's prolog.
1036Since user's can create their own headers, \f3enscript\f1 don't know
1037what resources those headers use.  That's why all headers must contain
1038a standard DSC comment that lists all needed resources.  For example,
1039used fonts can be listed with following comment:
1040
1041%%DocumentNeededResources: font \f2fontname1\f1 \f2fontname2\f1
1042
1043Comment can be continued to the next line with the standard
1044continuation comment:
1045
1046%%+ font \f2fontname3\f1
1047
1048.SH SPECIAL ESCAPES
1049
1050\f3Enscript\f1 supports special escape sequences which can be used to
1051add some page formatting commands to ASCII documents.  As a default,
1052special escapes interpretation is off, so all ASCII files print out as
1053everyone expects.  Special escapes interpretation is activated by
1054giving option \f3\-e\f1, \f3\-\-escapes\f1 to \f3enscript\f1.
1055
1056All special escapes start with the escape character.  The default
1057escape character is ^@ (octal 000); escape character can be changed
1058with option \f3\-e\f1, \f3\-\-escapes\f1.  Escape character is
1059followed by escape's name and optional options and arguments.
1060
1061Currently \f3enscript\f1 supports following escapes:
1062.TP 8
1063.B bggray
1064change the text background color.  Escape's syntax is:
1065
1066^@bggray{\f2gray\f1}
1067
1068where \f2gray\f1 is the new text background gray value.  The default
1069value is 1.0 (white).
1070.TP 8
1071.B color
1072change the text color.  Escape's syntax is:
1073
1074^@color{\f2red\f1 \f2green\f1 \f2blue\f1}
1075
1076where color components \f2red\f1, \f2green\f1 and \f2blue\f1 are given
1077as a decimal numbers between 0 and 1.
1078.TP 8
1079.B comment
1080comment the rest of the line including the newline character.
1081Escape's syntax is:
1082
1083^@comment \f2text\f1 \f2newline_character\f1
1084.TP 8
1085.B escape
1086change the escape character.  Escape's syntax is
1087
1088^@escape{\f2code\f1}
1089
1090where \f2code\f1 is the decimal code of the new escape character.
1091.TP 8
1092.B epsf
1093inline EPS file to the document.  Escape's syntax is:
1094
1095^@epsf[\f2options\f1]{\f2filename\f1}
1096
1097where \f2options\f1 is an optional sequence of option characters and
1098values enclosed with brackets and \f2filename\f1 is the name of the
1099EPS file.
1100
1101If \f2filename\f1 ends to the `|' character, then \f2filename\f1 is
1102assumed to name a command that prints EPS data to its standard output.
1103In this case, \f3enscript\f1 opens a pipe to the specified command
1104and reads EPS data from pipe.
1105
1106Following options can be given for the \f3epsf\f1 escape:
1107.RS 8
1108.TP 8
1109.B c
1110print image centered
1111.TP 8
1112.B r
1113print image right justified
1114.TP 8
1115.B n
1116do not update current point.  Following output is printed to that
1117position where the current point was just before the \f3epsf\f1 escape
1118.TP 8
1119.B nx
1120do not update current point \f2x\f1 coordinate
1121.TP 8
1122.B ny
1123do not update current point \f2y\f1 coordinate
1124.TP 8
1125.B x\f2num\f3
1126move image's top left \f2x\f1 coordinate \f2num\f1 characters from
1127current point \f2x\f1 coordinate (relative position)
1128.TP 8
1129.B x\f2num\f3a
1130set image's top left \f2x\f1 coordinate to column \f2num\f1 (absolute
1131position)
1132.TP 8
1133.B y\f2num\f3
1134move image's top left \f2y\f1 coordinate \f2num\f1 lines from current
1135line (relative position)
1136.TP 8
1137.B y\f2num\f3a
1138set image's top left \f2y\f1 coordinate to line \f2num\f1 (absolute
1139position)
1140.TP 8
1141.B h\f2num\f3
1142set image's height to \f2num\f1 lines
1143.TP 8
1144.B s\f2num\f3
1145scale image with factor \f2num\f1
1146.TP 8
1147.B sx\f2num\f3
1148scale image in \f2x\f1 direction with factor \f2num\f1
1149.TP 8
1150.B sy\f2num\f3
1151scale image in \f2y\f1 direction with factor \f2num\f1
1152.P
1153As a default, all dimensions are given in lines (vertical) and
1154characters (horizontal).  You can also specify other units by
1155appending an unit specifier after number.  Possible unit specifiers
1156and the corresponding units are:
1157.TP 8
1158.B c
1159centimeters
1160.TP 8
1161.B i
1162inches
1163.TP 8
1164.B l
1165lines or characters (default)
1166.TP 8
1167.B p
1168PostScript points
1169.P
1170For example to print an image one inch high, you can specify height by
1171following options: \f3h1i\f1 (1 inch), \f3h2.54c\f1 (2.54 cm),
1172\f3h72p\f1 (72 points).
1173.RE
1174.TP 8
1175.B font
1176select current font.  Escape's syntax is:
1177
1178^@font{\f2fontname\f1}
1179
1180where \f2fontname\f1 is a standard font specification.  Special font
1181specification \f3default\f1 can be used to select the default body
1182font (\f3enscript\f1's default or the one specified by the command
1183line option \f3\-f\f1, \f3\-\-font\f1).
1184.TP 8
1185.B ps
1186include raw PostScript code to the output.  Escape's syntax is:
1187
1188^@ps{\f2code\f1}
1189.TP 8
1190.B shade
1191highlight regions of text by changing the text background color.
1192Escape's syntax is:
1193
1194^@shade{\f2gray\f1}
1195
1196where \f2gray\f1 is the new text background gray value.  The default
1197value is 1.0 (white) which disables highlighting.
1198
1199.SH PAGE DEVICE OPTIONS
1200
1201Page device is a PostScript level 2 feature that offers an uniform
1202interface to control printer's output device.  \f3Enscript\f1
1203protects all page device options inside an if block so they have no
1204effect in level 1 interpreters.  Although all level 2 interpreters
1205support page device, they do not have to support all page device
1206options.  For example some printers can print in duplex mode and some
1207can not.  Refer to the documentation of your printer for supported
1208options.
1209
1210Here are some usable page device options which can be selected with
1211the \f3\-D\f1, \f3\-\-setpagedevice\f1 option.  For a complete listing,
1212see \f2PostScript Language Reference Manual\f1: section 4.11 Device
1213Setup.
1214.TP 8
1215.B Collate \f2boolean\f1
1216how output is organized when printing multiple copies
1217.TP 8
1218.B Duplex \f2boolean\f1
1219duplex (two side) printing
1220.TP 8
1221.B ManualFeed \f2boolean\f1
1222manual feed paper tray
1223.TP 8
1224.B OutputFaceUp \f2boolean\f1
1225print output `face up' or `face down'
1226.TP 8
1227.B Tumble \f2boolean\f1
1228how opposite sides are positioned in duplex printing
1229
1230.SH PRINTING EXAMPLES
1231
1232Following printing examples assume that \f3enscript\f1 uses the
1233default configuration.  If default actions have been changed from the
1234configuration files, some examples will behave differently.
1235.TP 8
1236.B enscript foo.txt
1237Print file \f3foo.txt\f1 to the default printer.
1238.TP 8
1239.B enscript \-Possu foo.txt
1240Print file \f3foo.txt\f1 to printer \f3ossu\f1.
1241.TP 8
1242.B enscript \-pfoo.ps foo.txt
1243Print file \f3foo.txt\f1, but leave PostScript output to file
1244\f3foo.ps\f1.
1245.TP 8
1246.B enscript \-2 foo.txt
1247Print file \f3foo.txt\f1 to two columns.
1248.TP 8
1249.B enscript \-2r foo.txt
1250Print file to two columns and rotate output 90 degrees (landscape).
1251.TP 8
1252.B enscript \-DDuplex:true foo.txt
1253Print file in duplex (two side) mode (printer dependant).
1254.TP 8
1255.B enscript \-G2rE \-U2 foo.c
1256My default code printing command: gaudy header, two columns,
1257landscape, code highlighting, 2-up printing.
1258.TP 8
1259\f3enscript \-E \-\-color \-Whtml \-\-toc -pfoo.html *.h *.c\f1
1260A nice HTML report of your project's C source files.
1261
1262.SH ENVIRONMENT VARIABLES
1263
1264The environment variable \f3ENSCRIPT\f1 can be used to pass default
1265options for \f3enscript\f1.  For example, to select the default body
1266font to be Times\-Roman 7pt, set the following value to the
1267\f3ENSCRIPT\f1 environment variable:
1268.TP 8
1269.B \-fTimes\-Roman7
1270.P
1271
1272The value of the \f3ENSCRIPT\f1 variable is processed before the
1273command line options, so command line options can be used to overwrite
1274these defaults.
1275
1276Variable \f3ENSCRIPT_LIBRARY\f1 specifies the \f3enscript\f1's
1277library directory.  It can be used to overwrite the build-in default
1278`@prefix@/share/enscript'.
1279
1280.SH RETURN VALUE
1281
1282\f3Enscript\f1 returns value 1 to the shell if any errors were
1283encountered.  On successfull termination, the return code is
1284constucted from the following flags:
1285.TP 8
1286.B 0
1287no errors or warnings
1288.TP 8
1289.B 2
1290some lines were truncated or wrapped
1291.TP 8
1292.B 4
1293some characters were missing from the used fonts
1294.TP 8
1295.B 8
1296some characters were unprintable
1297
1298.SH FILES
1299
1300.nf
1301.ta 4i
1302@prefix@/share/enscript/*.hdr           header files
1303@prefix@/share/enscript/*.enc           input encoding vectors
1304@prefix@/share/enscript/enscript.pro    PostScript prolog
1305@prefix@/share/enscript/*.afm           AFM files for PostScript fonts
1306@prefix@/share/enscript/font.map        index for the AFM files
1307@prefix@/share/enscript/enscript.st     states definition file
1308@prefix@/etc/enscript.cfg               system\-wide configuration file
1309@prefix@/etc/enscriptsite.cfg           site configuration file
1310~/.enscriptrc                           personal configuration file
1311~/.enscript/                            personal resource directory
1312.fi
1313
1314.SH SEE ALSO
1315diffpp(1), ghostview(1), gs(1), lpq(1), lpr(1), lprm(1), states(1)
1316
1317.SH AUTHOR
1318Markku Rossi <mtr@iki.fi> <http://www.iki.fi/~mtr/>
1319
1320GNU Enscript WWW home page: <http://www.iki.fi/~mtr/genscript/>
Note: See TracBrowser for help on using the repository browser.