home *** CD-ROM | disk | FTP | other *** search
/ The Pier Shareware 6 / The_Pier_Shareware_Number_6_(The_Pier_Exchange)_(1995).iso / 036 / fold341.zip / FOLD.DOC < prev    next >
Text File  |  1994-08-27  |  44KB  |  1,132 lines

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