home *** CD-ROM | disk | FTP | other *** search
/ High Voltage Shareware / high1.zip / high1 / DIR16 / FOLD32.ZIP / FOLD.DOC < prev    next >
Text File  |  1993-09-14  |  42KB  |  1,084 lines

  1.  
  2.                                FOLD-and-PRINT
  3.                                  version 3.2
  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: suppose you want to print both parts of the user's
  29. guide to Pretty Good Privacy, popular freeware public-key encryption program.
  30. It takes 74 pages if you just send both files to printer.  But it takes only
  31. 23 pages when you remove page headings and print joined manual parts with
  32. FOLD-and-PRINT in two columns on any ESC/P compatible printer using 80 lines
  33. of 160 characters per page which is still very readable.  It is less than one
  34. third of the original amount of paper necessary to make the printout...
  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 mattrix 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 analyzis 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 analyzis.
  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 cloumn use 'tt' option, for
  190. example, compare the analyzis 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' ot '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 prevoius 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 '/'.
  381. Options must be separated: something like '/i/da' is legal but treated as
  382. '/i', you should use '/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 occurance 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.2:
  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 analyzis
  421.   -a:  force text analyzis (-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 charcters
  459.   -cr: remove non-printable charcters
  460.   -ca: abort if non-printable charcters found (default)
  461.   -g<nnn>: set tab width (default: 8)
  462.   -z<file>: send output to a <file>, default is PRN
  463.   -p<file>: use given printer definition <file>, default is DEFAULT.P
  464.   -?:  display help screen
  465.  
  466.  
  467. And here is the detailed description of all options (options in parens are
  468. shortcuts):
  469.  
  470.  
  471. -1, -2, -3,...  -9
  472.  
  473.         These options can be used to specify the desired number of columns
  474. which FOLD-and-PRINT should use when printing text.  If none of them is
  475. specified, FOLD-and-PRINT will analyze the text first and then prompt user to
  476. specify the number of columns.  However if 'a' option is on, FOLD-and-PRINT
  477. will always analyze the text.
  478.  
  479.         If any two of these options are given the last is valid.  Everything
  480. after the digit is ignored.
  481.  
  482.  
  483.   -a
  484.  
  485.         This option forces the text analyzis.  FOLD-and-PRINT reads the text
  486. first and displays how many pages, and how many cuts you will get if you use
  487. 1, 2, 3, up to 9 columns of text.  Then you will be prompted to press [1],
  488. [2], ...  [9] to start or [ESC] to quit.
  489.  
  490.         The analyzis is very fast: on 386 40 MHz it was around 3500 lines of
  491. the text per second.
  492.  
  493.         Please note, that you will always be prompted to press a key, even if
  494. you turn on 'n' option.
  495.  
  496.  
  497.   -tt
  498.  
  499.         This option will tell FOLD-and-PRINT to truncate lines that don't fit
  500. in a column.  The text that is truncated will not be printed anywhere on the
  501. page.  Normally too long lines are printed in 2 or more lines in a column.
  502.  
  503.  
  504.   -tw
  505.  
  506.         This option will tell FOLD-and-PRINT to use word wrap when breaking
  507. too long lines that do not fit in a column.
  508.  
  509.         A word is a sequence of letters and/or digits.  If a word is longer
  510. than the column width it is truncated.
  511.  
  512.  
  513.   -tb
  514.  
  515.         This option will tell FOLD-and-PRINT to break too long lines.  This is
  516. on by default setting.  There's always one-space gap betwwen adjancent
  517. columns.
  518.  
  519.  
  520.   -tW, -tB
  521.  
  522.         Same as 'tw' and 'tb' but if the part of the line to be moved to the
  523. next line does not contain letters and digits, it is ignored and not printed.
  524.  
  525.  
  526.   -qh
  527.  
  528.         This option causes FOLD-and-PRINT ask user for a header and a footer
  529. to be used in printing a file.  User may use special characters described
  530. below.  Entering empty line for the even header/footer causes the odd one to
  531. be used.
  532.  
  533.  
  534.   -qt
  535.  
  536.         This option causes FOLD-and-PRINT ask user for a title to be used in
  537. printing a file.  A title is inserted in a header/footer in the place of %T or
  538. %=.  The default title is a file name.  Entering empty title causes the file
  539. name to be used.
  540.  
  541.  
  542.   -qa (-q)
  543.  
  544.         This has the effect of both 'qh' and 'qt'.
  545.  
  546.  
  547.   -q-
  548.  
  549.         This disables asking for a header, a footer, and a title.  The default
  550. contents from a .P file are used.
  551.  
  552.  
  553.   -da (-d)
  554.  
  555.         This option tells FOLD-and-PRINT not to print any headers or footers.
  556. It works even if 'qh', 'qt', or 'qa' was used.
  557.  
  558.  
  559.   -df
  560.  
  561.         This option tells FOLD-and-PRINT not to print any headers or footers
  562. on the first page (page number one to be precise: see 'r').  It works even if
  563. 'qh', 'qt', or 'qa' was used.
  564.  
  565.  
  566.   -d-
  567.  
  568.         This can be used to revoke 'da' or 'df'.  All headers and footers are
  569. printed.  This is the default setting.
  570.  
  571.  
  572.   -ml, -mr
  573.  
  574.         This options activate using left ('ml') or right ('mr') margins.  The
  575. width of the margin (in characters) is taken from a printer definition file
  576. and can be overriden with 'M' option.
  577.  
  578.  
  579.   -mb
  580.  
  581.         This option tells FOLD-and-PRINT to make margins which will make easy
  582. to put a printout into a binder: left margins on the odd pages and right
  583. margins on the even pages.  The width of the margin (in characters) is taken
  584. from a printer definition file and can be overriden with 'M' option.
  585.  
  586.  
  587.   -m-
  588.  
  589.         This disables using margins. This is the default setting.
  590.  
  591.  
  592.   -Mnnn
  593.  
  594.         This options can be used to redefine the margin width to nnn
  595. characters.
  596.  
  597.  
  598.   -fnnn
  599.  
  600.         All pages before the nnn'th page will not be printed.  The first
  601. printed page will be nnn'th or the one after nnn'th if 'oe' and 'oo' options
  602. does not allow printing of the nnn'th page.
  603.  
  604.  
  605.   -lnnn
  606.  
  607.         All pages after the nnn'th page will not be printed.  The last printed
  608. page will be nnn'th or the one before nnn'th if 'oe' and 'oo' options does not
  609. allow printing of the nnn'th page.
  610.  
  611.  
  612.   -snnn
  613.  
  614.         Only the nnn'th page will be printed.  The '-snnn' is a shortcut for
  615. '-fnnn -lnnn -oa'.  You can print only one page using this option, specifying
  616. '-s10 -s11' will result in printing of the 11th page.
  617.  
  618.  
  619.   -rnnn
  620.  
  621.         To all page numbers printed in headers/footers nnn will be added.  For
  622. example, if you use 'r10', the page number 1 will have number 11, 2 - 12, and
  623. so on.  It is possible to use negative values also.  This is useful when you
  624. print a document contained in many files.
  625.  
  626.  
  627.   -oe
  628.  
  629.         FOLD-and-PRINT will print only even-numbered pages of the specified
  630. range.  To be precise: it will not print odd-numbered pages.
  631.  
  632.  
  633.   -oo
  634.  
  635.         FOLD-and-PRINT will print only odd-numbered pages of the specified
  636. range.  To be precise: it will not print even-numbered pages.
  637.  
  638.  
  639.   -ox
  640.  
  641.         This option causes FOLD-and-PRINT to print odd-numbered pages first,
  642. and even-numbered pages next.  It is a shortcut for two FOLD-and-PRINT
  643. invokations: one with 'oo' and one with 'oe'.
  644.  
  645.  
  646.   -oa
  647.  
  648.         FOLD-and-PRINT will print all pages from the range specified by the
  649. 'f' and 'l' options.  This is the default setting.
  650.  
  651.  
  652.   -n
  653.  
  654.         Normally FOLD-and-PRINT before it starts printing a page it stops,
  655. allowing you to change the sheet of paper, and displays a question like this:
  656.  
  657.                 Page 4: reading....  print (Y/n/a)?
  658.  
  659. You may press [Y] (or [ENTER]) to print this page, [N] not to print, or [A] to
  660. print this and all following pages without the prompts.  [ESC] aborts the
  661. program.  If 'n' option is used FOLD-and-PRINT does not ask these questions
  662. and prints the page immediately after it has been read in and prepared for
  663. printing.
  664.  
  665.  
  666.   -b[n]
  667.  
  668.         n is a digit 2, 3, up to 9. It can be omitted and in this case 2 is
  669. assumed.  FOLD-and-PRINT will boldface a printout: each line of text will be
  670. printed n times without a linefeed.  A 'b-' resumes printing a line once.
  671.  
  672.  
  673.   -i
  674.  
  675.         This makes FOLD-and-PRINT print on the last page, which is usually not
  676. filled up, the text defined in the printer defintion file in the middle of the
  677. blank space. The default text is this:
  678.  
  679.               [  This space has been intentionally left blank  ]
  680.  
  681. The text is not printed if there is less than 10 empty lines left on the last
  682. page.
  683.  
  684.  
  685.   -ci
  686.  
  687.         This makes FOLD-and-PRINT ignore (treat as all other characters)
  688. control characters which may be printer control codes and can mess up a
  689. printout.
  690.  
  691.  
  692.   -cr
  693.  
  694.         This makes FOLD-and-PRINT remove (not to send to a printer) control
  695. characters which may be printer control codes and can mess up a printout.
  696.  
  697.  
  698.   -ca
  699.  
  700.         This makes FOLD-and-PRINT abort when control characters occur.  This
  701. is the default setting.
  702.  
  703.  
  704.   -gnnn
  705.  
  706.         nnn is a number from 2 to 32.  This sets TAB width to nnn, ie.  TABs
  707. are expanded to every nnn'th column.  Default is 8.
  708.  
  709.  
  710.   -zfilespec
  711.  
  712.         When this parameter is given in command line FOLD-and-PRINT will not
  713. send the text being printed to a printer (ie.  file PRN) but to the file
  714. specified after 'z'.  filespec is any valid file name.  If the specified file
  715. exist it will be overwritten without a warning.  You have just been warned.
  716.  
  717.  
  718.   -pfilespec
  719.  
  720.         Normally FOLD-and-PRINT uses printer control codes, page layout, and
  721. other configurable information from the printer definition file DEFAULT.P.  If
  722. you want to use another printer definition file use 'p' option followed by
  723. file specification.  The default extension which you can omit is '.P'.  The
  724. file is first searched for in the current directory and then in the directory
  725. in which FOLD.EXE resides.
  726.  
  727.  
  728.   -?
  729.  
  730.         Use this to display the help screen.  FOLD-and-PRINT will not do
  731. anything else if this option is given.  The help screen is not displayed if
  732. you run FOLD-and-PRINT without any parameters as it was in versions 2.91 thru
  733. 3.1.
  734.  
  735.  
  736.  
  737.  
  738. HINTS
  739. -----
  740.  
  741.         Here are some hints which you may find helpful in using
  742. FOLD-and-PRINT.  Please also have a look at hints after the 'Configuring...'
  743. section.
  744.  
  745.         * FOLD-and-PRINT can print in one column too.  If you want to print a
  746. text in one column with the designed-by-you headers and footers, and have all
  747. features of FOLD-and-PRINT, just tell FOLD-and-PRINT to use 1 column.  For
  748. example:
  749.  
  750.                 FOLD -1 SOMETEXT.ASC
  751.  
  752.         * The text analyzis is very helpful; you may want to use 'a' option in
  753. the FOLD variable.  Before you print anything you may look at what number of
  754. columns will be the best for a text --- minimum cuts and pages.
  755.  
  756.         * If in the analyzis you see that the last page is filled in less than
  757. 10 percent you may want to remove some blank lines from the text to make it
  758. fit on fewer pages.  Especially if the text contains groups of more than one
  759. empty line.
  760.  
  761.         * All trailing spaces are removed from the input text to avoid
  762. breaking blank lines.
  763.  
  764.         * If you use 'qa', 'qt', 'qh', use 'ox' instead of 'oe' and 'oo' to
  765. avoid re-typing the texts of a header, a footer, and/or a title.
  766.  
  767.         * When you use 'qh' or 'qa' and are asked for a header/footer for even
  768. pages and you just hit [ENTER], the header/footer entered for odd pages is
  769. used.
  770.  
  771.         * When you use 'qt' or 'qa' and are asked for a title and you just hit
  772. [ENTER], the file name used.
  773.  
  774.  
  775.  
  776.  
  777. COFIGURING FOLD-and-PRINT
  778. =========================
  779.  
  780.         FOLD-and-PRINT uses printer definition files to make the full use of
  781. specific capabilities of your printer.  The printer definition file is an
  782. ASCII file that contains all data needed by FOLD-and-PRINT to print a text in
  783. the specific mode.
  784.  
  785.         A single printer definition file contains information about page size
  786. and layout (length of the page in lines, width of the line in characters, the
  787. number of lines at the top and bottom of the page used for margins, the
  788. position within these margins of a header and a footer, and in the end a text
  789. of the header and the footer) and information needed to correctly print in
  790. this mode (printer control codes used to initialize and terminate printing
  791. mode and codes to be printed before and after each page).
  792.  
  793.  
  794.  
  795.  
  796. SAMPLE PRINTER DEFINITION FILE
  797. ------------------------------
  798.  
  799.         The structure of a printer definition file is very simple and very
  800. rigorous.  It will be described in detail with the use of an example.  Here it
  801. is one of the example printer definition files (the left margin of two tabs
  802. and line numbers are NOT included in the real file (DEFAULT.P) and are only
  803. used to explain the contents of the file in this documentation and for further
  804. explanation).  The comments (texts after a ';') are truncated and shortened
  805. --- you may want to print the original DEFAULT.P file as it is fully commented
  806. and may be used as a reference.  Only numbered lines are important.  Here it
  807. is:
  808.  
  809.  
  810.                 ;
  811.                 ; The next two lines *must not* be changed.
  812.                 ;
  813.         1       FOLD-and-PRINT printer definition file
  814.         2       REV 3 BEGIN
  815.                 ;
  816.                 ; The next three lines are for your information only.
  817.                 ; They are displayed on screen while FOLD-and-PRINT is w...
  818.                 ; They contain: the file creator/modifier, printer and f...
  819.                 ;
  820.         3       Konrad Budych
  821.         4       any ESC/P compatible printer
  822.         5       condensed Elite pitch
  823.                 ;
  824.                 ; The next line contains page layout parameters:
  825.                 ;   * 2 numbers: page length (in chars) and height (in l...
  826.                 ;   * 2 numbers: size of top and bottom margins (in line...
  827.                 ;   * 2 numbers: position of header and footer inside to...
  828.                 ;   * 2 numbers: position of line of '-'s inside top and...
  829.                 ;   * 1 number:  default margin size in chars, can be ch...
  830.                 ;
  831.         6       85 160 2 3 1 3 2 -1 10
  832.                 ;
  833.                 ; Now headers text with special symbols (described in FO...
  834.                 ; The first line contains a header for odd, the second f...
  835.                 ;
  836.         7       %B %d, %Y%^%=
  837.         8       %=%^%B %d, %Y
  838.                 ;
  839.                 ; The footers text (first for odd, then even pages).
  840.                 ;
  841.         9       %^- %# -%^
  842.         10      %^- %# -%^
  843.                 ;
  844.                 ; The printer initialization codes (\xx is hex code).
  845.                 ;
  846.         11      \1B@\0F\1B8\1BM\1B0\1BR\00\1Bt\01\1B6
  847.                 ;
  848.                 ; The printer de-initializtion codes.
  849.                 ;
  850.         12      \1B@\07
  851.                 ;
  852.                 ; The page initialization codes.
  853.                 ;
  854.         13
  855.                 ;
  856.                 ; The page de-initialization codes.
  857.                 ;
  858.         14      \0C
  859.                 ;
  860.                 ; The next line is printed in the middle of the blank s...
  861.                 ; if -i option is used and there is at least 10 empty l...
  862.                 ;
  863.         15      [ This space has been intentionally left blank ]
  864.                 ;
  865.                 ; The next line *must not* be changed.
  866.                 ;
  867.         16      END
  868.                 ;
  869.                 ; The rest of this file is ignored.
  870.                 ;
  871.  
  872.  
  873.         The 1st, 2nd, and 16th lines are necessary for FOLD-and-PRINT and
  874. always have the same contents.  Everything after 16th line is ignored.
  875.  
  876.         Lines 3 thru 5 contain the text describing the file cretor (line 3),
  877. your printer (line 4) and the print mode which is used (line 5).  They are
  878. only displayed on the screen and have no meaning to 'the real work'.
  879.  
  880.         The 6th line contains 9 numbers and they are respectively:
  881. * the length of the page in lines (85 in the example)
  882. * the width of the line in characters (160 in the example)
  883. * the number of empty lines at the top of page used as margin (2)
  884. * the number of empty lines at the bottom of page used as margin (3)
  885. * the position of the line with header within the top margin (1)
  886. * the position of the line with footer within the bottom margin (3)
  887. * the position of the line of hyphens within the top margin (2)
  888. * the position of the line of hyphens within the bottom margin (-1, disabled)
  889. * the default width of a margin (10 characters)
  890.  
  891.         If the 'position' numbers are out of range defined by 3rd and 4th
  892. number, the header/footer and/or hyphens will not be printed.
  893.  
  894.         The 7th and 8th lines contain the headers text and the 9th and 10th
  895. the footer.  First line of both pairs contains a text for odd pages, the
  896. second, for even ones.  This can be any text of your choice and you may use
  897. some special symbols there (they all begin with '%', a time is the time of
  898. printing, number of seconds and minutes will change through pages):
  899.  
  900. %T or %=        user's title (file name or a text entered by user)
  901. %F or %*        name of printed file
  902. %N or %#        current page number
  903. %^              space filler (see below)
  904. %a or %A        weekday name (abbr or full)
  905. %b or %B        month name (abbr or full)
  906. %c              date and time (DON'T USE! See notes below)
  907. %d              2 digits, day of month (01..31)
  908. %H or %I        2 digits, hour (00..23 or 01..12)
  909. %j              3 digits, day of year
  910. %m              2 digits, month decimal (01..12)
  911. %M              2 digits, minute (00..59)
  912. %p              AM or PM
  913. %S              2 digits, second (00..59)
  914. %U or %W        2 digits, week number (Sun is 1st or Mon is 1st day of week)
  915. %w              weekday decimal (0 = Sunday)
  916. %y or %Y        year (00..99 or 4 digit)
  917. %x              date
  918. %X              time
  919. %Z              time zone name (DON'T USE! See notes below)
  920. %%              %
  921.  
  922. You should not use %c which gives date and time because it also appends
  923. new-line characters and this may spoil your calculations (two lines printed
  924. instead of one) and a printout.  Also %Z should not be used unless you have
  925. environmental variable TZ set properly --- this variable describes the time
  926. difference between your time zone and Greenwich Mean Time.  I will not
  927. describe its format here and you are unlikely to use time zone name as a part
  928. of the header in your printouts.  But if you really want --- please see the
  929. description of 'strftime' and 'tzset' C library functions for details in any
  930. serious C compiler manuals.
  931.  
  932.         Space fillers allow to use left- or right-justified headers and
  933. footers as well as centered ones.  Each space filler (%^) is replaced with a
  934. string of spaces, all fillers in one header/footer are replaced by the same
  935. number of spaces.  The total number of spaces in all fillers plus length of a
  936. text is equal to line length.  Some examples should clear it:
  937.  
  938.         %^Page %#.%^
  939.  
  940. Text will be centered (the same number of spaces from each side).
  941.  
  942.         File %*%^Page %#
  943.  
  944. Texts will be in both corners (a lot of spaces between).
  945.  
  946.         %^TOP SECRET%^TOP SECRET%^
  947.  
  948. The first text will be in 1/3rd and the second in 2/3rd of line length.
  949.  
  950.         Note that the same symbols can be used when FOLD-and-PRINT asks you
  951. for a header and a footer when 'qh' or 'qa' option is used.  User's title
  952. defaults to the file name unless 'qt' or 'qa' is used.
  953.  
  954.         Lines 11 thru 14 contain printer control codes which are used:
  955. * to initialize the printer and turn on the desired print mode (line 11)
  956. * to return the printer to default mode after printing is complete (line 12)
  957. * to initialize printing of each page (line 13)
  958. * to end printing of each page (line 14)
  959.  
  960.         Non-visible control codes or non-ASCII charcters can be entered as
  961. hexadecimal codes in the format '\nn' (without quotes) where nn are exactly
  962. two hex digits (0..9, A..F).  For example \1B is ESC (ASCII 27) character.
  963.  
  964.         In the example shown above we initialize the printer with ESC @
  965. (standard initialize for ESC/P printers) \0F (= SI condensed printing) ESC 8
  966. (ignore out of paper --- alows printing more on the page) ESC M (Elite pitch)
  967. ESC R 0 ESC t 1 ESC 6 (use IBM character set I, allow printing upper codes,
  968. and use US characters --- this is not important, but allows printing texts
  969. with characters > 128).  We de-initialize printer with ESC @ BELL (some
  970. printers rings when they receive bell character and this let you know that
  971. printing is finished...  if you have very quiet printer).  After each page we
  972. send FF (form feed) to spit out the page.
  973.  
  974.         Line 15 contains a text printed in the middle of the last page if a
  975. 'i' option is used.
  976.  
  977.  
  978.  
  979.  
  980. HOW DOES FOLD-and-PRINT USE THE PRINTER DEFINITION FILE?
  981. --------------------------------------------------------
  982.  
  983.         Here is the detailed algorithm of what use FOLD-and-PRINT makes of
  984. each item in the printer definition file:
  985.  
  986.         First two lines and the 16th line are ignored, but necessary; lines 3
  987. thru 5 are displayed on-screen and also ignored.  Numbers in the 6th line (PL
  988. - page length, LW - line width, MT - top margin, MB - bottom margin, LH - line
  989. with header, LF - line with footer, HH - line of hyphens in header, HF - line
  990. of hyphens in footer, BM - margin size; BM is internally reset to zero if 'm-'
  991. option is used) are used to calculate column width (which is equal to: (LW -
  992. BM) / #_of_columns - 1) and some other numbers...
  993.  
  994.         FOLD-and-PRINT starts with sending control codes from line 11 to the
  995. printer.  Then for the each page it repeats:
  996.  
  997. * sending control codes from line 13
  998.  
  999. * printing PL lines of which:
  1000.  
  1001.   ** first MT lines are blank except for:  LH'th line which contains header as
  1002.      found in line 5 with expanded symbols beginning with '%' and HH'th line
  1003.      which contains LW - BM hyphens
  1004.  
  1005.   ** next PL - (MT + MB) contain a text formatted in a number of columns of
  1006.      your choice (1 to 9)
  1007.  
  1008.   ** last MB lines are blank except for:  LF'th line which contains footer as
  1009.      found in line 6 with expanded symbols beginning with '%' and HF'th line
  1010.      which contains LW - BM margins
  1011.  
  1012. * printing control codes from line 14
  1013.  
  1014. The printing is terminated with sending control characters from line 12.
  1015.  
  1016.         Each line of text contains a pair of CR and LF characters at the end
  1017. so you must turn off auto line feed feature of your printer if it is on.
  1018. Surely it is off --- most programs require that it is off.
  1019.  
  1020.         It is all that you need to set up your printer.  Please remember that
  1021. FOLD-and-PRINT absolutely relies on you and assumes that you configured it
  1022. correctly.  If the printer prints strange things --- it is most likely your
  1023. fault!  Please read 'Hints...' below for the last help on configuring.
  1024.  
  1025.  
  1026.  
  1027.  
  1028. HINTS AND TROUBLESHOOTING
  1029. -------------------------
  1030.  
  1031.         Here are some notes which you may find helpful in configuring
  1032. FOLD-and-PRINT and if you have troubles with FOLD-and-PRINT:
  1033.  
  1034.         * If every other line printed is full and every another is not, and
  1035. page does not fit on a single sheet, you decrease the value of line width
  1036. (line is simply too long) or change some codes to decrease character pitch.
  1037.  
  1038.         * If line spacing is too large, turn off the auto line feed feature in
  1039. your printer or put in printer definition file some codes which decrease line
  1040. spacing.
  1041.  
  1042.         * If a page does not fit on a single sheet of paper (eg.  the footer
  1043. is printed on the next sheet) reduce the page length value or make printer
  1044. ignore the end of paper (the latter is often better --- it is possible to
  1045. print the footer at the very end of the sheet).
  1046.  
  1047.         * When you use fanfold paper always turn off the skip over perforation
  1048. and adjust top and bottom margins.
  1049.  
  1050.         * If you use fanfold paper and the second (and next) page(s) do(es)
  1051. not start at the same position as first, calculate page length, divide by line
  1052. spacing and put apropriate values in the printer definition file, or...
  1053.  
  1054.         * If you use fanfold paper and the second (and next) page(s) do(es)
  1055. not start at the same position as first, calculate page length, put codes to
  1056. set this value in line 11 (printer initialization) and add FF (form feed) to
  1057. line 14.
  1058.  
  1059.  
  1060.  
  1061.  
  1062. FINAL NOTES
  1063. ===========
  1064.  
  1065.         Some legal issues and other information are not included in this part
  1066. of the manual --- they are not necessary here and may annoy someone who wants
  1067. to get some help out of this text and does not want to browse through revision
  1068. history, acknowledgements, etc.  Also such information may annoy much more if
  1069. you have a habit of printing software documentation.
  1070.  
  1071.         So please have a look at FOLDADD.DOC sometime...
  1072.  
  1073.         This file has become incredibly long!  It is longer than FOLD.EXE and
  1074. it is also longer than a source FOLD.C file.  But it still does not have the
  1075. "Table of contents"...  Look for "======" to find section beginnings or
  1076. "------" to find subsection beginnings.
  1077.  
  1078.  
  1079.  
  1080.  
  1081.                              End of User's Manual
  1082.                              ********************
  1083.  
  1084.