home *** CD-ROM | disk | FTP | other *** search
/ High Voltage Shareware / high1.zip / high1 / DIR16 / FOLD33.ZIP / FOLD.DOC < prev    next >
Text File  |  1993-11-11  |  43KB  |  1,101 lines

  1.  
  2.                                FOLD-and-PRINT
  3.                                  version 3.3
  4.  
  5.                                 User's Manual
  6.  
  7.                           (C) Konrad Budych 1989-93
  8.  
  9.  
  10.         FOLD-and-PRINT is a utility that allows you to print an ASCII text in
  11. a multi-column format using either single sheets or a fanfold paper on
  12. (probably) any line printer.  This saves paper costs and makes it easier to
  13. read texts.  It is useful when you want to print long source code listings,
  14. software documentation, or any long and unformatted ASCII texts.
  15.  
  16.         FOLD-and-PRINT always prints in text mode to avoid slow graphics
  17. printing and may use all features that are specific to your printer as the
  18. program is completely configurable.  It is possible to print selected pages of
  19. the text: even-, or odd-numbered, starting from, or ending after a given page.
  20. You may prepare easily printouts that you may bind in a binder.  All features
  21. are described later in this manual.
  22.  
  23.         I have been using and writing this program for more than 3 years.  It
  24. was improved, changed, and rewritten many times.  As I find it really useful I
  25. think it may be useful to others too.  Just give it a try, play with some
  26. configurations, and very soon you will discover its value.
  27.  
  28.         Real life example: the Canonical List of Blonde Jokes dated 27 Sep
  29. 1993 takes 34 pages (17 sheets) if just copied to printer.  But it takes only
  30. 13 pages (10 sheets saved) if printed in two columns on any ESC/P compatible
  31. printer using 80 lines of 160 characters or 6 pages (14 sheets saved) if
  32. printed in three columns on ESC/P2 printer (Epson LQ-100) using 128 lines of
  33. 192 characters.  Of course the sheet size is always the same.  And magnifying
  34. glass is not necessary to read these printouts.
  35.  
  36.         Laser printer users: sorry.  This program cannot be configured to page
  37. oriented printers, you can use it only if your printer is or emulates some
  38. line printer.
  39.  
  40.  
  41.  
  42.  
  43. WHAT DOES FOLD-and-PRINT EXACTLY DO?
  44. ====================================
  45.  
  46.         When you print a text with 'COPY ATEXT.EXT PRN', 'PRINT ATEXT.EXT', or
  47. something similar, you usually get a sheet or two (or hundred) of paper or few
  48. meters (or miles) of fanfold paper that has text printed only near the left
  49. margin, has about 50 to 60 lines on page, and is printed with font which you
  50. can set on the printer's panel.
  51.  
  52.         When you browse through the user's manual of any printer, you should
  53. see, that the printer can print in many modes that are mostly unused by
  54. professional, big applications.  These applications usually offer much more
  55. features, but they print mostly in graphic modes, and if you have a slow
  56. printer you sooner or later stop using them for printing ASCII texts (if you
  57. have ever started).
  58.  
  59.         Most dot matrix printers can emulate ESC/P commands.  This commands
  60. allow to select different font pitches and line spacings.  It is no magic to
  61. print 80 lines of 160 characters on a page.  This is still very readable and
  62. there is about 3 times more text on such a page than when you use default 55
  63. lines of 80 characters.  Of course if your printer does not support ESC/P
  64. commands you may still use FOLD-and-PRINT.  Only you will probably have to
  65. experiment with different features of your printer.
  66.  
  67.         What FOLD-and-PRINT really does is this: it formats a given ASCII
  68. texts into multi-column format, and sends it to the printer, page by page,
  69. preceded and followed by some control codes.  The page length, width, margins,
  70. line spacing, etc.  are all up to you.  Just give FOLD-and-PRINT control codes
  71. to be sent to printer, tell it how many lines fit on a page, how many
  72. characters fit in a line, and that's all!  You may make your printouts even in
  73. 9 columns from now!
  74.  
  75.         To find more details on how to configure FOLD-and-PRINT see below.  If
  76. your printer supports ESC/P (most printers do), you may test using the example
  77. configurations included in the package.
  78.  
  79.  
  80.  
  81.  
  82. HOW TO INSTALL FOLD-and-PRINT?
  83. ==============================
  84.  
  85.         Follow these simple rules when installing FOLD-and-PRINT:
  86.  
  87. * All *.P files should be in the same directory in which you keep FOLD.EXE.
  88. * It is nice to be able to run FOLD-and-PRINT from any directory and drive.
  89. * Do not install FOLD-and-PRINT if you do not have DOS version 3.0 or newer.
  90.  
  91.         You may just copy FOLD.EXE and *.P files to some directory listed in
  92. your PATH, or create separate directory (like C:\FOLD) and create a BATch file
  93. in one of directories listed in PATH.  The batch may look like this:
  94.  
  95.                 @echo off
  96.                 set fold=-tW -qt -i
  97.                 c:\fold\fold.exe %1 %2 %3 %4 %5 %6 %7 %8 %9
  98.                 set fold=
  99.                 echo on
  100.  
  101.         The FOLD environmental variable is used to turn on default options.
  102. You may SET it in the batch, in AUTOEXEC.BAT, or do not set it at all if you
  103. do not need it.  See below for options description.
  104.  
  105.         After you have learned how to use and configure FOLD-and-PRINT, do not
  106. keep *.DOC files on your hard disk --- the manuals are longer than the program
  107. itself!  Just hide the original archive file on some forgotten diskette in
  108. case you ever want to read this text again or your hard disk crashes.
  109. FOLD.EXE and a couple of .P files is enough to use FOLD-and-PRINT.
  110.  
  111.  
  112.  
  113.  
  114. USING FOLD-and-PRINT
  115. ====================
  116.  
  117.         First you will be presented some examples introducing step by step the
  118. major features of FOLD-and-PRINT.  The complete syntax and full options
  119. description is presented at the end of this section.
  120.  
  121.         All these examples assume that you have FOLD-and-PRINT configured and
  122. ready to use.  If your printer supports ESC/P, FOLD-and-PRINT is ready to use
  123. with default parameters: the condensed Elite font of 80 lines of 160
  124. characters per page is used by default.  Use another mode by copying any .P
  125. file to DEFAULT.P or (which is better) using 'p' option, for example:
  126.  
  127.                 FOLD -pTINY FOLD.DOC
  128.  
  129.   If your printer does not support ESC/P commands you will have to configure
  130. FOLD-and-PRINT first.  See 'COFIGURING FOLD-and-PRINT' section for details.
  131.  
  132.  
  133.  
  134.  
  135. QUICK START
  136. -----------
  137.  
  138.         To print this file in two columns run:
  139.  
  140.                 FOLD -2 FOLD.DOC
  141.  
  142. You will be prompted for confirmation before the printing starts, and before
  143. each page.  Pressing [ESC] always exits to DOS.
  144.  
  145.         If you want to know how many pages of the text will be produced by
  146. FOLD-and-PRINT run:
  147.  
  148.                 FOLD FOLD.DOC
  149.  
  150. FOLD-and-PRINT will analyze the text first, and display how many pages, and
  151. how many 'cuts' (see below) you will get if you use 1, 2, 3, up to 9 columns
  152. of text.  Then you will be prompted to press [1], [2], ...  [9] to start or
  153. [ESC] to quit.  You may always force the analysis of a text using 'a' option:
  154.  
  155.                 FOLD -2 -a FOLD.DOC
  156.  
  157. In this case when prompted you just have to press [ENTER] to use 2 columns.
  158. Of course, thanks to 'a' option, you may use 3 or 8 columns even if you
  159. specified '2' in command line.
  160.  
  161.  
  162.  
  163.  
  164. WHEN COLUMN IS TOO NARROW
  165. -------------------------
  166.  
  167.         When column is too narrow a 'cut' occurs.  Normally the text which
  168. would not fit in a column will be printed in the same column in the next line.
  169. The number of cuts in texts can be determined in text analysis.
  170.  
  171.         When the text is cut, a word may be broken in any place.  When many
  172. words in text are broken, the text becomes illegible.  To prevent this, you
  173. may use 'tw' option.  This makes FOLD-and-PRINT not break words in the middle,
  174. but move an entire word to the next line in the same column.  For example:
  175.  
  176.                 FOLD -4 FOLD.DOC
  177.  
  178. would produce a very hard to read printout, but
  179.  
  180.                 FOLD -4 -tw FOLD.DOC
  181.  
  182. would produce a not so hard to read printout.  Sometimes when a word is longer
  183. than the width of a column it is not possible to leave it intact.  In such
  184. cases FOLD-and-PRINT will behave as if the 'tw' option was off.
  185.  
  186.         You may not want to print the line endings that do not fit in a
  187. column.  They may contain less important information (like comments in
  188. assembly language source code :).  You may cut them to give a printout a nicer
  189. look.  To truncate lines that do not fit in a column use 'tt' option, for
  190. example, compare the analysis results of:
  191.  
  192.                 FOLD -tt FOLD.DOC
  193.  
  194. and
  195.  
  196.                 FOLD FOLD.DOC
  197.  
  198. especially in 4 or more column modes.
  199.  
  200.         When the text being printed contain TAB characters you may try to
  201. change TAB width to make the text narrower.  To do this, use 'g' parameter
  202. as in example:
  203.  
  204.                 FOLD -g3 -t FOLD.DOC
  205.  
  206. This will cause FOLD-and-PRINT to expand TAB characters to every 3rd position
  207. (1, 4, 7, and so on) and not to every 8th as it is done by default.
  208.  
  209.         To restore the original mode of breaking lines, use 'tb' option.  It
  210. may be useful when you SET 'tt' or 'tw' in FOLD variable and want to override
  211. this setting.
  212.  
  213.         The 'tB' and 'tW' options act almost the same way as 'tb' and 'tw'.
  214. The difference appears if a line to be cut contains no letters nor digits only
  215. graphics or punctuation: if 'tB' or 'tW' is used the part to be moved to the
  216. next line is ignored and is not printed.
  217.  
  218.  
  219.  
  220.  
  221. WHEN A RIBBON IS WEAK
  222. ---------------------
  223.  
  224.         If you print a lot of texts, sooner or later a ribbon in your printer
  225. will become weak and printouts gray instead of black.  You may of course
  226. replace the ribbon, but if it is weak and you very much want to print
  227. something in black FOLD-and-PRINT can help.  Use 'b' option to print each line
  228. not once but twice, or 'b3' to print each line 3 times up to 'b9' which tells
  229. FOLD-and-PRINT to print each line 9 times.  The latter is cruel for the
  230. printer, but if you cannot afford a new ribbon...  For example:
  231.  
  232.                 FOLD -2 -b3 FOLD.DOC
  233.  
  234. will print FOLD.DOC in two columns each line three times.
  235.  
  236.  
  237.  
  238.  
  239. WHEN A TEXT IS LONG
  240. -------------------
  241.  
  242.         When a text you print is very long and you print it on a fanfold paper
  243. or you have a sheet feeder, you may do not want to sit and look the at printer
  244. working, and pressing [ENTER] from time to time to confirm printing of
  245. succeeding pages.  Or you may want to print first the left pages and then the
  246. right pages on the same sheets to make a book-like printout.  FOLD-and-PRINT
  247. can help in each situation:
  248.  
  249.                 FOLD -n -2 FOLD.DOC
  250.  
  251. This will print FOLD.DOC in two columns but you will be able to leave the
  252. printer unattended as no user action will be necessary.  You only have to
  253. confirm the start of printing.
  254.  
  255.         If you want to print only even- or odd-numbered pages of a text use
  256. 'oe' and 'oo' options:
  257.  
  258.                 FOLD -oo -n FOLD.DOC
  259.  
  260.                 FOLD -oe -n FOLD.DOC
  261.  
  262. These two commands will cause printing the one half of FOLD.DOC first and then
  263. the other half next.  Both halves will be printed in no-wait mode described
  264. above.
  265.  
  266.         If you are going to print first one half of a text (odd pages) and
  267. then the second half (even pages), you may use 'ox' option:
  268.  
  269.                 FOLD -ox -n FOLD.DOC
  270.  
  271. This command does exactly the same what the previous two.  You will hear a
  272. beep and be prompted to press a key after all odd pages have been printed.
  273. The 'oa' option selects default mode.
  274.  
  275.         To print only specified range of pages you may use 'f', 'l', and 's'
  276. options.  Here are some examples:
  277.  
  278.                 FOLD -f3 FOLD.DOC
  279.  
  280. This will print FOLD.DOC starting with page 3.
  281.  
  282.                 FOLD -f3 -l4 FOLD.DOC
  283.  
  284. This will print FOLD.DOC starting with page 3 and ending after page 4.
  285.  
  286.                 FOLD -s4 FOLD.DOC
  287.  
  288. This will print 4th page of FOLD.DOC.  Please note that '-s4' is a shortcut
  289. for '-f4 -l4 -oa' and that 'oe', 'oo' and 'ox' options can be combined with
  290. 'f' and 'l'.
  291.  
  292.         When the text is really very long, and you keep it in separate files,
  293. which you print in turn, you may change the way FOLD-and-PRINT assigns page
  294. numbers.  Normally the first page has number 1 (no matter you print it or not)
  295. and so on. This can be changed with 'r' option:
  296.  
  297.                 FOLD -r67 FOLD.DOC
  298.  
  299. This will print FOLD.DOC, but the first page will have number 68 and so on.
  300. So when you print a second part of a big text, know that first part had (for
  301. example) 43 pages, you add 'r43' in the next FOLD-and-PRINT run.
  302.  
  303.         It is possible to use 'r' with negative values:
  304.  
  305.                 FOLD -r-3 -s4 FOLD.DOC
  306.  
  307. This will print 4th page of FOLD.DOC with number 1.
  308.  
  309.  
  310.  
  311.  
  312. WHEN YOU HAVE A BINDER
  313. ----------------------
  314.  
  315.         If you like to keep all sheets of your printout tightly bound
  316. together, you may tell FOLD-and-PRINT to leave margins which will allow
  317. binding sheets:
  318.  
  319.                 FOLD -2 -mb FOLD.DOC
  320.  
  321. This will print FOLD.DOC in two columns.  Right pages (odd-numbered) will have
  322. a left margin and left pages (even-numbered) will have a right margin so the
  323. printout will be excellent to be put in a binder.
  324.  
  325.         Please note that all columns are more narrow if use use this option.
  326. This may increase the number of cuts in a text.
  327.  
  328.         The width of the binder margin can be set up in the printer definition
  329. file (see below) and changed from command line with 'M' option. For example:
  330.  
  331.                 FOLD -2 -mb -M20 FOLD.DOC
  332.  
  333.         The 'ml' and 'mr' options can be used to print a text with margin
  334. always on the left ('ml') or the right ('mr') side.  This may be useful in
  335. some situations.
  336.  
  337.  
  338.  
  339.  
  340. HEADERS AND FOOTERS
  341. -------------------
  342.  
  343.         At the top of every page FOLD-and-PRINT usually prints a header.  At
  344. the bottom of every page FOLD-and-PRINT usually prints a footer.  What they
  345. contain is determined by the contents of the printer configuration file being
  346. used (see below) and a title which is defined for a single session.
  347.  
  348.         The contents of headers and footers are defined separately for odd and
  349. even pages in the printer configuration file.  The special symbol pairs
  350. consisting of a percent sign (%) and a character can be used if you want page
  351. numbers, date, time, file name appear in the headers and footers.  See
  352. 'COFIGURING FOLD-and-PRINT' section for a full list of these symbols.  A
  353. special symbol pair is %T or %= defines 'user's title'.  It defaults to file
  354. name but if you use 'qt' or 'qa' options you will be able to enter your own
  355. text, for example, a document's title.
  356.  
  357.         Suppose you want to print a text with some special headers or footers.
  358. You don't need to change the printer configuration files, you may use 'qh' or
  359. 'qa' options.  It causes FOLD-and-PRINT to ask you for a text of the header
  360. and the footer before it prints anything, if 'qa' is used you will be asked
  361. also for a title.  The 'q-' can be used to disable asking for anything.
  362.  
  363.         Suppose you want to print a bare text, without any header nor footers.
  364. You may use 'da' option.  FOLD-and-PRINT will not print any header or footer
  365. on any page it this mode.  To disable printing headers and footers only on the
  366. first page use 'df' option. The 'd-' switches to default mode.
  367.  
  368.  
  369.  
  370.  
  371. COMPLETE SYNTAX AND OPTIONS DESCRIPTION
  372. ----------------------------------------
  373.  
  374.         You may run 'FOLD -?' to see the help screen.
  375.  
  376.         The full syntax is as follows:
  377.  
  378.                 FOLD [options] filename [options]
  379.  
  380.         Options may be preceded by either '-' or '/'.  Options must be
  381. separated: something like '/i/da' is legal but treated as '/i', you should use
  382. '/i /da'.
  383.  
  384.         Single letter options (like 'i', 'n') are turned on when they are
  385. followed by a '+' or nothing (eg.  '-i+ -n') and turned off when followed by a
  386. '-' (eg.  '-i-').  Please note the they are no longer switches: '-n' always
  387. turns no-pause mode on and *does not* toggle this mode as it was in versions
  388. 2.91 to 3.1.
  389.  
  390.         The groups of two-letter options (like 'oo', 'oe', 'ox', 'oa') can be
  391. considered as multi-position switches: only one option of the group is active
  392. at the moment.
  393.  
  394.         The options with parameters require that there is no space between the
  395. option letter and a parameter; for example '-f 120' is invalid, but '-f120' is
  396. okay.  If such an option is used twice or more the last occurence is valid,
  397. all earlier are ignored.  The numbers (nnn) must never be zero.  Page numbers
  398. are from 1 to 9999.
  399.  
  400.         The content of environmental variable FOLD is always scanned before
  401. any command line arguments, so you may turn on some options using this
  402. variable.
  403.  
  404.         Filename is any legal DOS filename with optional drive and path.
  405. Wildcards ('*' and '?') are not allowed and only one file name can be given.
  406. Error occurs otherwise.
  407.  
  408.         Single '-' or '/' in command line disables option scanning.  This
  409. feature may be used to print a file with the name beginning with '-'.  For
  410. example:
  411.  
  412.                 FOLD -ox -tW - -A-FILE.TXT
  413.  
  414.         Here is the full list of options that are available in FOLD-and-PRINT
  415. version 3.3:
  416.  
  417. Page layout:
  418.   -1, -2,... -9: specify number of columns
  419.      if none of these is used, user is asked to select her/his
  420.      choice after a text analysis
  421.   -a:  force text analysis (-a- to disable)
  422.   -tb: break long lines (default)
  423.   -tB: same, ignore ends without alphanumeric chars
  424.   -tw: break long lines using word wrap
  425.   -tW: same, ignore ends without alphanumeric chars
  426.   -tt: truncate long lines
  427.  
  428. Headers and footers
  429.   -qh: ask for headers and footers to be used in this session
  430.   -qt: ask for user defined title used in header/footer
  431.   -qa: ask for headers, footers, and title (also -q)
  432.   -q-: don't ask, use defaults from .P file (default)
  433.   -da: disable all headers and footers (also -d)
  434.   -df: disable headers and footers on the 1st page
  435.   -d-: don't omit headers and footers (default)
  436.  
  437. Margins:
  438.   -m-: no margins (default)
  439.   -ml: left margins
  440.   -mr: right margins
  441.   -mb: margins for binder: left on odd, right on even pages
  442.   -M<nnn>: set margin width (default in .P file)
  443.  
  444. Page selection and numbering:
  445.   -f<nnn>: first page to print (default: 1)
  446.   -l<nnn>: last page to print (default: 9999)
  447.   -s<nnn>: print only <nnn>'th page
  448.   -r<nnn>: add <nnn> to page numbers (default: 0)
  449.   -oo: only odd pages
  450.   -oe: only even pages
  451.   -ox: two passes: first odd, then even pages
  452.   -oa: all pages (default)
  453.  
  454. Miscellaneous:
  455.   -n:  don't wait for confirmation before each page (-n- to disable)
  456.   -b<n>: print each line <n> times (<n> is 2..9, default: 2)
  457.   -i:  print blank-space message on the last page (-i- to disable)
  458.   -ci: ignore (send to output) non-printable characters
  459.   -cr: remove non-printable characters
  460.   -cs: substitute non-printable characters with '@'
  461.   -ca: abort if non-printable characters found (default)
  462.   -g<nnn>: set tab width (default: 8)
  463.   -z<file>: send output to a <file>, default is PRN
  464.   -p<file>: use given printer definition <file>, default is DEFAULT.P
  465.   -P<path>: specify path for printer definition files
  466.   -?:  display help screen
  467.  
  468.  
  469. And here is the detailed description of all options (options in parens are
  470. shortcuts):
  471.  
  472.  
  473. -1, -2, -3,...  -9
  474.  
  475.         These options can be used to specify the desired number of columns
  476. which FOLD-and-PRINT should use when printing text.  If none of them is
  477. specified, FOLD-and-PRINT will analyze the text first and then prompt user to
  478. specify the number of columns.  However if 'a' option is on, FOLD-and-PRINT
  479. will always analyze the text.
  480.  
  481.         If any two of these options are given the last is valid.  Everything
  482. after the digit is ignored.
  483.  
  484.  
  485.   -a
  486.  
  487.         This option forces the text analysis.  FOLD-and-PRINT reads the text
  488. first and displays how many pages, and how many cuts you will get if you use
  489. 1, 2, 3, up to 9 columns of text.  Then you will be prompted to press [1],
  490. [2], ...  [9] to start or [ESC] to quit.
  491.  
  492.         The analysis is very fast: on 386 40 MHz it was around 1500 lines of
  493. the text per second.
  494.  
  495.         Please note, that you will always be prompted to press a key, even if
  496. you turn on 'n' option.
  497.  
  498.  
  499.   -tt
  500.  
  501.         This option will tell FOLD-and-PRINT to truncate lines that don't fit
  502. in a column.  The text that is truncated will not be printed anywhere on the
  503. page.  Normally too long lines are printed in 2 or more lines in a column.
  504.  
  505.  
  506.   -tw
  507.  
  508.         This option will tell FOLD-and-PRINT to use word wrap when breaking
  509. too long lines that do not fit in a column.  The part of line that is moved to
  510. the next line is always left justified.
  511.  
  512.         A word is a sequence of letters and/or digits.  If a word is longer
  513. than the column width it is truncated.
  514.  
  515.  
  516.   -tb
  517.  
  518.         This option will tell FOLD-and-PRINT to break too long lines.  This is
  519. on by default setting.  There's always one-space gap between adjacent
  520. columns.
  521.  
  522.  
  523.   -tW, -tB
  524.  
  525.         Same as 'tw' and 'tb' but if the part of the line to be moved to the
  526. next line does not contain letters and digits, it is ignored and not printed.
  527.  
  528.  
  529.   -qh
  530.  
  531.         This option causes FOLD-and-PRINT ask user for a header and a footer
  532. to be used in printing a file.  User may use special characters described
  533. below.  Entering empty line for the even header/footer causes the odd one to
  534. be used.
  535.  
  536.  
  537.   -qt
  538.  
  539.         This option causes FOLD-and-PRINT ask user for a title to be used in
  540. printing a file.  A title is inserted in a header/footer in the place of %T or
  541. %=.  The default title is a file name.  Entering empty title causes the file
  542. name to be used.
  543.  
  544.  
  545.   -qa (-q)
  546.  
  547.         This has the effect of both 'qh' and 'qt'.
  548.  
  549.  
  550.   -q-
  551.  
  552.         This disables asking for a header, a footer, and a title.  The default
  553. contents from a .P file are used.
  554.  
  555.  
  556.   -da (-d)
  557.  
  558.         This option tells FOLD-and-PRINT not to print any headers or footers.
  559. It works even if 'qh', 'qt', or 'qa' was used.
  560.  
  561.  
  562.   -df
  563.  
  564.         This option tells FOLD-and-PRINT not to print any headers or footers
  565. on the first page (page number one to be precise: see 'r').  It works even if
  566. 'qh', 'qt', or 'qa' was used.
  567.  
  568.  
  569.   -d-
  570.  
  571.         This can be used to revoke 'da' or 'df'.  All headers and footers are
  572. printed.  This is the default setting.
  573.  
  574.  
  575.   -ml, -mr
  576.  
  577.         This options activate using left ('ml') or right ('mr') margins.  The
  578. width of the margin (in characters) is taken from a printer definition file
  579. and can be overridden with 'M' option.
  580.  
  581.  
  582.   -mb
  583.  
  584.         This option tells FOLD-and-PRINT to make margins which will make easy
  585. to put a printout into a binder: left margins on the odd pages and right
  586. margins on the even pages.  The width of the margin (in characters) is taken
  587. from a printer definition file and can be overridden with 'M' option.
  588.  
  589.  
  590.   -m-
  591.  
  592.         This disables using margins. This is the default setting.
  593.  
  594.  
  595.   -Mnnn
  596.  
  597.         This options can be used to redefine the margin width to nnn
  598. characters.
  599.  
  600.  
  601.   -fnnn
  602.  
  603.         All pages before the nnn'th page will not be printed.  The first
  604. printed page will be nnn'th or the one after nnn'th if 'oe' and 'oo' options
  605. does not allow printing of the nnn'th page.
  606.  
  607.  
  608.   -lnnn
  609.  
  610.         All pages after the nnn'th page will not be printed.  The last printed
  611. page will be nnn'th or the one before nnn'th if 'oe' and 'oo' options does not
  612. allow printing of the nnn'th page.
  613.  
  614.  
  615.   -snnn
  616.  
  617.         Only the nnn'th page will be printed.  The '-snnn' is a shortcut for
  618. '-fnnn -lnnn -oa'.  You can print only one page using this option, specifying
  619. '-s10 -s11' will result in printing of the 11th page.
  620.  
  621.  
  622.   -rnnn
  623.  
  624.         To all page numbers printed in headers/footers nnn will be added.  For
  625. example, if you use 'r10', the page number 1 will have number 11, 2 - 12, and
  626. so on.  It is possible to use negative values also.  This is useful when you
  627. print a document contained in many files.
  628.  
  629.         While this option is active (nnn is not 0) FOLD-and-PRINT will display
  630. the real page number is square brackets.
  631.  
  632.  
  633.   -oe
  634.  
  635.         FOLD-and-PRINT will print only even-numbered pages of the specified
  636. range.  To be precise: it will not print odd-numbered pages.
  637.  
  638.  
  639.   -oo
  640.  
  641.         FOLD-and-PRINT will print only odd-numbered pages of the specified
  642. range.  To be precise: it will not print even-numbered pages.
  643.  
  644.  
  645.   -ox
  646.  
  647.         This option causes FOLD-and-PRINT to print odd-numbered pages first,
  648. and even-numbered pages next.  It is a shortcut for two FOLD-and-PRINT
  649. invokations: one with 'oo' and one with 'oe'.
  650.  
  651.  
  652.   -oa
  653.  
  654.         FOLD-and-PRINT will print all pages from the range specified by the
  655. 'f' and 'l' options.  This is the default setting.
  656.  
  657.  
  658.   -n
  659.  
  660.         Normally FOLD-and-PRINT before it starts printing a page it stops,
  661. allowing you to change the sheet of paper, and displays a question like this:
  662.  
  663.                 Page 4: reading....  print (Y/n/a)?
  664.  
  665. You may press [Y] (or [ENTER]) to print this page, [N] not to print, or [A] to
  666. print this and all following pages without the prompts.  [ESC] aborts the
  667. program.  If 'n' option is used FOLD-and-PRINT does not ask these questions
  668. and prints the page immediately after it has been read in and prepared for
  669. printing.
  670.  
  671.  
  672.   -b[n]
  673.  
  674.         n is a digit 2, 3, up to 9. It can be omitted and in this case 2 is
  675. assumed.  FOLD-and-PRINT will boldface a printout: each line of text will be
  676. printed n times without a linefeed.  A 'b-' resumes printing a line once.
  677.  
  678.  
  679.   -i
  680.  
  681.         This makes FOLD-and-PRINT print on the last page, which is usually not
  682. filled up, the text defined in the printer definition file in the middle of the
  683. blank space. The default text is this:
  684.  
  685.               [  This space has been intentionally left blank  ]
  686.  
  687. The text is not printed if there is less than 10 empty lines left on the last
  688. page.
  689.  
  690.  
  691.   -ci
  692.  
  693.         This makes FOLD-and-PRINT ignore (treat as all other characters)
  694. control characters which may be printer control codes and can mess up a
  695. printout.
  696.  
  697.  
  698.   -cr
  699.  
  700.         This makes FOLD-and-PRINT remove (not to send to a printer) control
  701. characters which may be printer control codes and can mess up a printout.
  702.  
  703.  
  704.   -cs
  705.  
  706.         This makes FOLD-and-PRINT substitute control characters with '@'
  707. character and print them as normal characters.
  708.  
  709.  
  710.   -ca
  711.  
  712.         This makes FOLD-and-PRINT abort when control characters occur.  This
  713. is the default setting.
  714.  
  715.  
  716.   -gnnn
  717.  
  718.         nnn is a number from 2 to 32.  This sets TAB width to nnn, ie.  TABs
  719. are expanded to every nnn'th column.  Default is 8.
  720.  
  721.  
  722.   -zfilespec
  723.  
  724.         When this parameter is given in command line FOLD-and-PRINT will not
  725. send the text being printed to a printer (ie.  file PRN) but to the file
  726. specified after 'z'.  filespec is any valid file name.  If the specified file
  727. exist it will be overwritten without a warning.  You have just been warned.
  728.  
  729.  
  730.   -pfilespec
  731.  
  732.         Normally FOLD-and-PRINT uses printer control codes, page layout, and
  733. other configurable information from the printer definition file DEFAULT.P.  If
  734. you want to use another printer definition file use 'p' option followed by
  735. file specification.  The default extension which you can omit is '.P'.  The
  736. file is first searched for in the current directory, then in directory
  737. specified by '-P' option, and then in the directory in which FOLD.EXE resides.
  738.  
  739.  
  740.   -Ppath
  741.  
  742.         This option specifies additional path where FOLD-and-PRINT looks
  743. for printer definition files.  This path is searched *after* the current
  744. directory but *before* FOLD.EXE home directory.
  745.  
  746.  
  747.   -?
  748.  
  749.         Use this to display the help screen.  FOLD-and-PRINT will not do
  750. anything else if this option is given.  The help screen is not displayed if
  751. you run FOLD-and-PRINT without any parameters as it was in versions 2.91 thru
  752. 3.1.
  753.  
  754.  
  755.  
  756.  
  757. HINTS
  758. -----
  759.  
  760.         Here are some hints which you may find helpful in using
  761. FOLD-and-PRINT.  Please also have a look at hints after the 'Configuring...'
  762. section.
  763.  
  764.         * FOLD-and-PRINT can print in one column too.  If you want to print a
  765. text in one column with the designed-by-you headers and footers, and have all
  766. features of FOLD-and-PRINT, just tell FOLD-and-PRINT to use 1 column.  For
  767. example:
  768.  
  769.                 FOLD -1 SOMETEXT.ASC
  770.  
  771.         * The text analysis is very helpful; you may want to use 'a' option in
  772. the FOLD variable.  Before you print anything you may look at what number of
  773. columns will be the best for a text --- minimum cuts and pages.
  774.  
  775.         * If in the analysis you see that the last page is filled in less than
  776. 10 percent you may want to remove some blank lines from the text to make it
  777. fit on fewer pages.  Especially if the text contains groups of more than one
  778. empty line.
  779.  
  780.         * All trailing spaces are removed from the input text to avoid
  781. breaking blank lines.
  782.  
  783.         * If you use 'qa', 'qt', 'qh', use 'ox' instead of 'oe' and 'oo' to
  784. avoid re-typing the texts of a header, a footer, and/or a title.
  785.  
  786.         * When you use 'qh' or 'qa' and are asked for a header/footer for even
  787. pages and you just hit [ENTER], the header/footer entered for odd pages is
  788. used.
  789.  
  790.         * When you use 'qt' or 'qa' and are asked for a title and you just hit
  791. [ENTER], the file name used.
  792.  
  793.         * If you want to print a text in any number of columns you want,
  794. reformat the text so that each paragraph is a long line (but no longer than
  795. 255 characters) and use 'tw' or 'tW' options: FOLD-and-PRINT will reformat the
  796. text for you!
  797.  
  798.  
  799.  
  800.  
  801. CONFIGURING FOLD-and-PRINT
  802. ==========================
  803.  
  804.         FOLD-and-PRINT uses printer definition files to make the full use of
  805. specific capabilities of your printer.  The printer definition file is an
  806. ASCII file that contains all data needed by FOLD-and-PRINT to print a text in
  807. the specific mode.
  808.  
  809.         A single printer definition file contains information about page size
  810. and layout (length of the page in lines, width of the line in characters, the
  811. number of lines at the top and bottom of the page used for margins, the
  812. position within these margins of a header and a footer, and in the end a text
  813. of the header and the footer) and information needed to correctly print in
  814. this mode (printer control codes used to initialize and terminate printing
  815. mode and codes to be printed before and after each page).
  816.  
  817.  
  818.  
  819.  
  820. SAMPLE PRINTER DEFINITION FILE
  821. ------------------------------
  822.  
  823.         The structure of a printer definition file is very simple and very
  824. rigorous.  It will be described in detail with the use of an example.  Here it
  825. is one of the example printer definition files (the left margin of two tabs
  826. and line numbers are NOT included in the real file (DEFAULT.P) and are only
  827. used to explain the contents of the file in this documentation and for further
  828. explanation).  The comments (texts after a ';') are truncated and shortened
  829. --- you may want to print the original DEFAULT.P file as it is fully commented
  830. and may be used as a reference.  Only numbered lines are important.  Here it
  831. is:
  832.  
  833.  
  834.                 ;
  835.                 ; The next two lines *must not* be changed.
  836.                 ;
  837.         1       FOLD-and-PRINT printer definition file
  838.         2       REV 3 BEGIN
  839.                 ;
  840.                 ; The next three lines are for your information only.
  841.                 ; They are displayed on screen while FOLD-and-PRINT is w...
  842.                 ; They contain: the file creator/modifier, printer and f...
  843.                 ;
  844.         3       Konrad Budych
  845.         4       any ESC/P compatible printer
  846.         5       condensed Elite pitch
  847.                 ;
  848.                 ; The next line contains page layout parameters:
  849.                 ;   * 2 numbers: page length (in chars) and height (in l...
  850.                 ;   * 2 numbers: size of top and bottom margins (in line...
  851.                 ;   * 2 numbers: position of header and footer inside to...
  852.                 ;   * 2 numbers: position of line of '-'s inside top and...
  853.                 ;   * 1 number:  default margin size in chars, can be ch...
  854.                 ;
  855.         6       85 160 2 3 1 3 2 -1 10
  856.                 ;
  857.                 ; Now headers text with special symbols (described in FO...
  858.                 ; The first line contains a header for odd, the second f...
  859.                 ;
  860.         7       %X ver. %V on %C, %P%J%U
  861.         8       %U%J%X ver. %V on %C, %P
  862.                 ;
  863.                 ; The footers text (first for odd, then even pages).
  864.                 ;
  865.         9       %J- %N -%J
  866.         10      %J- %N -%J
  867.                 ;
  868.                 ; The printer initialization codes (\xx is hex code).
  869.                 ;
  870.         11      \1B@\0F\1B8\1BM\1B0\1BR\00\1Bt\01\1B6
  871.                 ;
  872.                 ; The printer de-initialization codes.
  873.                 ;
  874.         12      \1B@\07
  875.                 ;
  876.                 ; The page initialization codes.
  877.                 ;
  878.         13
  879.                 ;
  880.                 ; The page de-initialization codes.
  881.                 ;
  882.         14      \0C
  883.                 ;
  884.                 ; The next line is printed in the middle of the blank s...
  885.                 ; if -i option is used and there is at least 10 empty l...
  886.                 ;
  887.         15      [ This space has been intentionally left blank ]
  888.                 ;
  889.                 ; The next line *must not* be changed.
  890.                 ;
  891.         16      END
  892.                 ;
  893.                 ; The rest of this file is ignored.
  894.                 ;
  895.  
  896.  
  897.         The 1st, 2nd, and 16th lines are necessary for FOLD-and-PRINT and
  898. always have the same contents.  Everything after 16th line is ignored.
  899.  
  900.         Lines 3 thru 5 contain the text describing the file creator (line 3),
  901. your printer (line 4) and the print mode which is used (line 5).  They are
  902. only displayed on the screen and have no meaning to 'the real work'.
  903.  
  904.         The 6th line contains 9 numbers and they are respectively:
  905. * the length of the page in lines (85 in the example)
  906. * the width of the line in characters (160 in the example)
  907. * the number of empty lines at the top of page used as margin (2)
  908. * the number of empty lines at the bottom of page used as margin (3)
  909. * the position of the line with header within the top margin (1)
  910. * the position of the line with footer within the bottom margin (3)
  911. * the position of the line of hyphens within the top margin (2)
  912. * the position of the line of hyphens within the bottom margin (-1, disabled)
  913. * the default width of a margin (10 characters)
  914.  
  915.         If the 'position' numbers are out of range defined by 3rd and 4th
  916. number, the header/footer and/or hyphens will not be printed.
  917.  
  918.         The 7th and 8th lines contain the headers text and the 9th and 10th
  919. the footer.  First line of both pairs contains a text for odd pages, the
  920. second, for even ones.  This can be any text of your choice and you may use
  921. some special symbols there (they all begin with a '%'):
  922.  
  923. %U        user's title (file name or a text entered by user)
  924. %F        name of printed file
  925. %N        current page number
  926. %J        space filler (see below)
  927. %C        today's date
  928. %P        current time (it will be different on different pages)
  929. %D        file creation/last modification date
  930. %T        file creation/last modification time
  931. %S        file size in bytes
  932. %Z        file size in kilobytes (rounded)
  933. %X        text saying: 'Printed using FOLD-and-PRINT'
  934. %V        FOLD-and-PRINT version number
  935. %%        a '%' sign
  936.  
  937.         The date and time formats are those used by DOS.  Please also note,
  938. that the case of letters used in the symbols is important: '%u' is not the
  939. same as '%U'.
  940.  
  941.         Space fillers allow to use left- or right-justified headers and
  942. footers as well as centered ones.  Each space filler (%J) is replaced with a
  943. string of spaces, all fillers in one header/footer are replaced by the same
  944. number of spaces.  The total number of spaces in all fillers plus length of a
  945. text is equal to line length.  Some examples should clear it:
  946.  
  947.         %JPage %N.%J
  948.  
  949. Text will be centered (the same number of spaces from each side).
  950.  
  951.         File %F%JPage %N
  952.  
  953. Texts will be in both corners (a lot of spaces between).
  954.  
  955.         %JTOP SECRET%JTOP SECRET%J
  956.  
  957. The first text will be in 1/3rd and the second in 2/3rd of line length.
  958.  
  959.         Note that the same symbols can be used when FOLD-and-PRINT asks you
  960. for a header and a footer when 'qh' or 'qa' option is used.  User's title
  961. defaults to the file name unless 'qt' or 'qa' is used.
  962.  
  963.         Lines 11 thru 14 contain printer control codes which are used:
  964. * to initialize the printer and turn on the desired print mode (line 11)
  965. * to return the printer to default mode after printing is complete (line 12)
  966. * to initialize printing of each page (line 13)
  967. * to end printing of each page (line 14)
  968.  
  969.         Non-visible control codes or non-ASCII characters can be entered as
  970. hexadecimal codes in the format '\nn' (without quotes) where nn are exactly
  971. two hex digits (0..9, A..F).  For example \1B is ESC (ASCII 27) character.
  972.  
  973.         In the example shown above we initialize the printer with ESC @
  974. (standard initialize for ESC/P printers) \0F (= SI condensed printing) ESC 8
  975. (ignore out of paper --- allows printing more on the page) ESC M (Elite pitch)
  976. ESC R 0 ESC t 1 ESC 6 (use IBM character set I, allow printing upper codes,
  977. and use US characters --- this is not important, but allows printing texts
  978. with characters > 128).  We de-initialize printer with ESC @ BELL (some
  979. printers rings when they receive bell character and this let you know that
  980. printing is finished...  if you have very quiet printer).  After each page we
  981. send FF (form feed) to spit out the page.
  982.  
  983.         Line 15 contains a text printed in the middle of the last page if a
  984. 'i' option is used.
  985.  
  986.  
  987.  
  988.  
  989. HOW DOES FOLD-and-PRINT USE THE PRINTER DEFINITION FILE?
  990. --------------------------------------------------------
  991.  
  992.         Here is the detailed algorithm of what use FOLD-and-PRINT makes of
  993. each item in the printer definition file:
  994.  
  995.         First two lines and the 16th line are ignored, but necessary; lines 3
  996. thru 5 are displayed on-screen and also ignored.  Numbers in the 6th line (PL
  997. - page length, LW - line width, MT - top margin, MB - bottom margin, LH - line
  998. with header, LF - line with footer, HH - line of hyphens in header, HF - line
  999. of hyphens in footer, BM - margin size; BM is internally reset to zero if 'm-'
  1000. option is used) are used to calculate column width (which is equal to: (LW -
  1001. BM) / #_of_columns - 1) and some other numbers...
  1002.  
  1003.         FOLD-and-PRINT starts with sending control codes from line 11 to the
  1004. printer.  Then for the each page it repeats:
  1005.  
  1006. * sending control codes from line 13
  1007.  
  1008. * printing PL lines of which:
  1009.  
  1010.   ** first MT lines are blank except for:  LH'th line which contains header as
  1011.      found in line 5 with expanded symbols beginning with '%' and HH'th line
  1012.      which contains LW - BM hyphens
  1013.  
  1014.   ** next PL - (MT + MB) contain a text formatted in a number of columns of
  1015.      your choice (1 to 9)
  1016.  
  1017.   ** last MB lines are blank except for:  LF'th line which contains footer as
  1018.      found in line 6 with expanded symbols beginning with '%' and HF'th line
  1019.      which contains LW - BM margins
  1020.  
  1021. * printing control codes from line 14
  1022.  
  1023. The printing is terminated with sending control characters from line 12.
  1024.  
  1025.         Each line of text contains a pair of CR and LF characters at the end
  1026. so you must turn off auto line feed feature of your printer if it is on.
  1027. Surely it is off --- most programs require that it is off.
  1028.  
  1029.         It is all that you need to set up your printer.  Please remember that
  1030. FOLD-and-PRINT absolutely relies on you and assumes that you configured it
  1031. correctly.  If the printer prints strange things --- it is most likely your
  1032. fault!  Please read 'Hints...' below for the last help on configuring.
  1033.  
  1034.  
  1035.  
  1036.  
  1037. HINTS AND TROUBLESHOOTING
  1038. -------------------------
  1039.  
  1040.         Here are some notes which you may find helpful in configuring
  1041. FOLD-and-PRINT and if you have troubles with FOLD-and-PRINT:
  1042.  
  1043.         * If every other line printed is full and every another is not, and
  1044. page does not fit on a single sheet, you decrease the value of line width
  1045. (line is simply too long) or change some codes to decrease character pitch.
  1046.  
  1047.         * If line spacing is too large, turn off the auto line feed feature in
  1048. your printer or put in printer definition file some codes which decrease line
  1049. spacing.
  1050.  
  1051.         * If a page does not fit on a single sheet of paper (eg.  the footer
  1052. is printed on the next sheet) reduce the page length value or make printer
  1053. ignore the end of paper (the latter is often better --- it is possible to
  1054. print the footer at the very end of the sheet).
  1055.  
  1056.         * When you use fanfold paper always turn off the skip over perforation
  1057. and adjust top and bottom margins.
  1058.  
  1059.         * If you use fanfold paper and the second (and next) page(s) do(es)
  1060. not start at the same position as first, calculate page length, divide by line
  1061. spacing and put appropriate values in the printer definition file, or...
  1062.  
  1063.         * If you use fanfold paper and the second (and next) page(s) do(es)
  1064. not start at the same position as first, calculate page length, put codes to
  1065. set this value in line 11 (printer initialization) and add FF (form feed) to
  1066. line 14.
  1067.  
  1068.         * If you use two (or more) printers in your system and want to keep a
  1069. couple of .P files for each printer there are two solutions: 1) create a
  1070. unique names for all files (for example use some prefix for all files used by
  1071. a given printer); 2) move all .P files used by one printer to a separate
  1072. directories and use '-P' option; this is especially useful in BATch files: you
  1073. may want to create files named (for example): FOLD-EPS.BAT, FOLD-IBM.BAT, etc.
  1074. in which you SET the FOLD variable with (for example): '-Pc:\fold\epson', etc.
  1075.  
  1076.  
  1077.  
  1078.  
  1079. FINAL NOTES
  1080. ===========
  1081.  
  1082.         Some legal issues and other information are not included in this part
  1083. of the manual --- they are not necessary here and may annoy someone who wants
  1084. to get some help out of this text and does not want to browse through revision
  1085. history, acknowledgements, etc.  Also such information may annoy much more if
  1086. you have a habit of printing software documentation.
  1087.  
  1088.         So please have a look at FOLDADD.DOC sometime...
  1089.  
  1090.         This file has become incredibly long!  It is longer than FOLD.EXE and
  1091. it is also longer than a source FOLD.C file.  But it still does not have the
  1092. "Table of contents"...  Look for "======" to find section beginnings or
  1093. "------" to find subsection beginnings.
  1094.  
  1095.  
  1096.  
  1097.  
  1098.                              End of User's Manual
  1099.                              ********************
  1100.  
  1101.