home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD2.mdf / c / library / dos / printer / eprnew / epr.doc < prev   
Encoding:
Text File  |  1986-02-06  |  10.6 KB  |  265 lines

  1. epr.doc                V1.10-A                12/12/84
  2.  
  3.  
  4.         A SIMPLE LISTING PROGRAM FOR THE EPSON PRINTER
  5.  
  6.               Robert W. Sjoberg
  7.              hacked by Craig Milo Rogers
  8.  
  9.  
  10.     It is customary in the course of program development to output many
  11. pages of program listings.  Although typical microcomputer printers
  12. offer a wide range of format control, it is usually available only when
  13. using sophisticated editing and formatting programs (word processors).
  14. It would be useful to have a program that offers simplified if limited
  15. control when printing ordinary Ascii text files.  To this end, a program
  16. called epr has been written.  It takes advantage of many of the features
  17. of the Epson MX-80 and FX-80 printers, as well as allowing the user to
  18. specify the format of the output.  The following features are supported.
  19.  
  20.   * Pagination according to a fix but settable number of lines per
  21.     page.  For sheet-fed tasks, printing will pause between pages.
  22.  
  23.   * Selection of a user-specified heading, including insertion of file
  24.     name, date, time, and page number, or no header at all, or no header
  25.     on just the initial page.
  26.  
  27.   * Choice of top and left margins, line spacing, length and width of
  28.     page.
  29.  
  30.   * Choice of international character set, including whether the Epson
  31.     special characters (occupying some control codes) should be
  32.     recognized.
  33.  
  34.   * Choice of printing style (condensed, enlarged, pica, elite, etc.).
  35.  
  36.   * Control over formatting features:
  37.      - whether overflow lines are truncated or wrapped to the next
  38.        line;
  39.      - whether random control characters are printed or converted
  40.        to "^X" form;
  41.      - whether form feeds or additional blank lines separate pages;
  42.      - how tabs are to be expanded;
  43.  
  44.   * Selection of printing options through an indirect file.
  45.  
  46.     The command line to invoke epr is as follows.  Switch options are
  47. specified as single-characters, while options requiring values are
  48. given as keyword=value, with single-character keywords.  All options
  49. are detailed below.  The syntax was suggested by conventional Unix
  50. usage.  The brackets indicate that all options are just that, optional,
  51. and any may be omitted.
  52.  
  53.     epr [-acfhiops18] [l=leng] [w=wid] [t=topmar] [m=leftmar] [p=pmode]
  54.     [q=qmode] [c=country] [b=tabn] [h="header"] [f=optfile] [o=output]
  55.         [files...]
  56.  
  57. All options must come before the names of any files to be printed.
  58.  
  59.  
  60. Switch Options
  61. _____________
  62.  
  63.     These single-letter options may be specified individually, each with
  64. its own dash command, as "-a -c -8", or in groups, as "-ac8".  They may
  65. appear in any order in arbitrary groupings.  Multiple occurrences of a
  66. switch are equivalent to a single occurrence.
  67.  
  68.   -a    Select alternate (usually italic) character set.
  69.  
  70.   -c    Convert control chars (other than CR, LF, FF) to ^X form.
  71.  
  72.   -f    Use form feeds instead of blank lines to separate pages.
  73.  
  74.   -h    Suppress printing of any header, even if specified with
  75.     the h= option (below).  Does not suppress top margin.
  76.  
  77.   -i    Allow international characters (these occupy some control codes).
  78.  
  79.   -o    Overflow lines are truncated (by default, they are wrapped to
  80.     next line of output).
  81.  
  82.   -p    Pause at beginning of each page and wait for CR to be typed.
  83.     Intended to allow forms change or sheet-fed use.  Disables
  84.     out-of-paper detector.
  85.  
  86.   -s    Suppress output of printer control codes (only those that set
  87.     printer format, charcter set, and special features; ordinary
  88.     Ascii control codes are unaffected).
  89.  
  90.   -1    Don't print header on first page; does not print blank lines
  91.     instead of header, just doesn't print anything).
  92.  
  93.   -8    Use vertical spacing of 8 lines per inch (default is 6).
  94.  
  95. Keyword Options
  96. ________________
  97.  
  98.     Keyword options take the form "keyword=value", where "keyword" is a
  99. single-character keyword and "value" depends on the keyword.  These
  100. options may be intermingled with the dash option switches above and may
  101. appear in any order, as long as they all come before the names of the
  102. files to be printed.
  103.  
  104. l=leng
  105.     Use text page length of "leng" lines (default is 56 for normal
  106.     6 lines/inch spacing, 78 for 8 lines/inch spacing).  Does
  107.     not include top or bottom margins or the header.
  108.  
  109. w=wid
  110.     Use text page width of "wid" columns (default for normal Pica
  111.     print is 80; the default for other text styles varies from 40 to
  112.     137).  Does not include the left margin.
  113.  
  114. t=topmar
  115.     Set top margin to "topmar" lines.  Default is 0.
  116.  
  117. m=leftmar
  118.     Set left margin to "leftmar" characters.  Default is 0.
  119.  
  120. b=tabn
  121.     Causes implicit tab stops every "tabn" columns relative to the
  122.     left margin of the page.  A tab character (Ascii octal 011) will
  123.     skip to the next tab stop. The default is 8.
  124.  
  125. p=pmode
  126.     Set printer mode.  The default mode is pica (10 characters
  127.     per inch).  String "pmode" (not enclosed in quotation marks)
  128.     contains any collection of the following letters (any combination
  129.     may be specified, although not all combinations are effective):
  130.     b   bold (emphasized) characters
  131.     c   condensed characters, 17.16 per inch
  132.     d   double-strike characters
  133.     i   italic characters
  134.     l   elite characters, 12 per inch
  135.     p   proportional spacing
  136.     s   subscript characters
  137.     t   top (ie, superscript) characters
  138.     u   underlined characters
  139.     Example:  p=bdl   causes bold (emphasized), double-struck, elite
  140.               characters to be used.
  141.  
  142. q=qmode
  143.     Set the printer mode for the header line.  The values for "qmode"
  144.     are the same as for "pmode" in "p=pmode".
  145.  
  146. c=country
  147.     Selects the country character set.  Value "country" is a two-letter
  148.     abbreviation for the country:
  149.       us for U.S.A.        sw for Sweden
  150.       fr for France        it for Italy
  151.       ge for Germany    sp for Spain
  152.       uk for U.K.        ja for Japan
  153.       de for Denmark
  154.     See the Epson manual for the actual character code mapping.
  155.     The default is c=us for U.S.A.
  156.  
  157. h="header"
  158.     Use the given header.  The specified header is contained in quotes
  159.     and appears as the first thing typed on every page.  The header
  160.     string is interpreted as in the C programming language.  Thus,
  161.     certain combinations of characters have special meaning:
  162.     \n means newline, \t means tab, \r means return (without
  163.     advancing to a new line), \b means backspace, and \\ means
  164.     backslash.  A \ followed by one to three octal digits encodes
  165.     the specified ASCII character;  this may be used to insert
  166.     Epson control sequences (italics, etc) in the header.  A \ followed
  167.     by any other character is left as is.
  168.  
  169.     In addition, certain other character combinations have special
  170.     meanings:
  171.     %d  substitutes date in the form dd mmm yyyy, as 23 Jul 1983
  172.     %t  substitutes time in the form hh:mm, as 14:37
  173.     %f  substitutes file name as given on command line
  174.     %p  substitutes page number
  175.     %%  substitutes %
  176.     %   (% followed by a space) substitutes a single space
  177.     Any other %<char> combination is ignored (deleted).  The default
  178.     header is the string "%d %t %f Page %p\n\n", that is, the date,
  179.     the time, the current file name, "Page", the page number, and two
  180.     blank lines (another \n is supplied after the header is typed).
  181.     The quotes surrounding the header string in the command line may
  182.     be any single character delimiter that does not appear in the
  183.     header string itself; double quote (") was used here as an example.
  184.     Note that the specification h="" still results in a single \n as
  185.     the header.  This can be inhibited with the -h switch.
  186.  
  187. f=optfile
  188.     Specifies that more options are to be read from file optfile.
  189.     The format of optfile should be the same as that of the command
  190.     line except that options may be spread over several lines (that
  191.     is, newlines in optfile are turned into spaces, as are tabs).
  192.     The resulting options are spliced into the epr command line at
  193.     the point the f= is given.  This option is provided to allow
  194.     often-used formats to be easily invoked, and to allow CP/M users
  195.     a method of defining headers with both upper and lower case
  196.     characters, since CP/M converts its command lines to all upper
  197.     case.
  198.  
  199.     For example, the following file (called "listform") is the
  200.     author's favorite for listing programs:
  201.         -f8 t=0 p=c l=80
  202.     To format and print files foo.c and bar.c, the command line is
  203.     simply
  204.         epr f=listform foo.c bar.c
  205.  
  206.     A more complicated option file is "invnform":
  207.         -f t=1 -1 p=l m=10
  208.         h="Equipment Inventory,% %d\t\t\tPage% %p"
  209.     Notice the "% " is used to quote the spaces, since PC-DOS and
  210.     the C86 _main service routine will cause the command line to be
  211.     broken into the following tokens:
  212.         h="Equipment
  213.         Inventory,%
  214.         %d\t\t\tPage%
  215.         %p"
  216.     Epr interpolates a space after the % in the second and third
  217.     tokens.
  218.  
  219. o=output
  220.     Specifies that output is to be written to the named file instead
  221.     of directly to the printer.  If no "output" string is given,
  222.     that is, if only o= appears, then output is to standard output.
  223.  
  224. File specifications must come after any and all options.  If no file
  225. specifications are present on the command line, epr reads from standard
  226. input.  epr does not expand wildcard characters (* or ?) in file
  227. specifications.
  228.  
  229. Notes
  230. _____
  231.  
  232. (1) The printer modes set by epr remain in effect after epr exits:
  233.     - printer typestyle and character size;
  234.     - international character set;
  235.     - line spacing;
  236.     - normal/alternate character set;
  237.     - out-of-paper detection is disabled (if -p used);
  238.     - automatic skip over perforation is cancelled.
  239.  
  240. (2) This program was developed on a Compaq computer using Computer
  241.     Innovations C86 compiler, V1.3.3.  It has not been tested on later
  242.     releases of C86, but should exhibit no pathologic behavior.
  243.     CMR:  This version was hacked on an IBM-PC/AT using Lattice C 2.12.
  244.     It should still work on with CI C86.
  245.  
  246. (3) The following files are required to build epr:
  247.     epr.c        C source file
  248.     timestmp.c    contains time and date functions
  249.     timestmp.h    include file for above
  250.  
  251. (4) This program is furnished to the public domain for non-commercial
  252.     use.  It may not be sold or otherwise commercially distributed for
  253.     profit, in its original form or in any derivational form.  It may
  254.     be copied and distributed freely, without charge to recipients.
  255.     If you see fit to improve this program, you are welcome to do so
  256.     PROVIDED (1) you clearly indicate the changes in the Revision History
  257.     section of the source code, (2) you include your name and handle
  258.     (network or U.S. Mail address is sufficient), and (3) you provide
  259.     an original source copy of this program to anyone who receives the
  260.     modified copy.
  261.  
  262. (5) The epr and timestmp programs are provided "as is" with no promise
  263.     of support.  However, the author will gladly entertain reports of
  264.     bugs and misfeatures, as well as commentary on it use and performance.
  265.