home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1994 #1 / monster.zip / monster / PRINT / PRNF245.ZIP / PRN2B222.EXE / PRN2BOTH.DOC < prev    next >
Text File  |  1993-07-26  |  21KB  |  336 lines

  1.  
  2. ________PRN2BOTH                                                            v. 2.22
  3.  
  4.  
  5.  
  6. Purpose: Prepares an ASCII text file for printing on both sides of the
  7.          paper by copying it to two files, one containing the odd and the
  8.          other containing the even pages.  Its intended use is on files
  9.          which have been formatted for printing with FF's (the form-feed
  10.          character, ASCII #12) or by the proper number of blank lines to
  11.          fill out the bottom of the page.
  12.  
  13. Format:  PRN2BOTH [[filespec] [/L[#]nn] [/Mnn,nn,nn] [/Rn[,n[,n[,n]]]]]
  14.                            [/A] [/N] [/?]
  15.  
  16.          All you really must enter is PRN2BOTH.  Any option you don't spec-
  17.          ify on the command line will be asked for interactively.
  18.  
  19.          ________         filespec may contain drive and path specs, but not wildcards.
  20.  
  21.          ____         /Lnn specifies the maximum page length.  If a form-feed is found
  22.              in the first page (that is, in the first nn lines), Prn2Both
  23.              will ignore your spec and go by form-feeds.  If none are found
  24.              in the first nn lines, Prn2Both will (a) insert FF's every nn
  25.              lines, and (b) convert any FF's it finds into nulls (ASCII
  26.              #0).  If you do not specify a page length it defaults to 63,
  27.              but you get a chance to change it.
  28.  
  29.              ___________             Note change: page length specifications must now start with
  30.              /L.  (In earlier versions, they just started with /nn.)
  31.  
  32.          ___         /L# says the file is self-paged with blank lines.  In this case,
  33.              Prn2Both inserts no FF's and converts any it finds into nulls.
  34.  
  35.              By itself, /L# gives you 66 lines per page.  Putting a number
  36.              with it: /L#nn tells Prn2Both that the file is designed to
  37.              page itself every nn lines.  Prn2Both will break the pages
  38.              that way, nulling any FF's it finds and inserting no FF's.
  39.                                                               _______             This is not normal practice; it implies that the printer gets
  40.              nn lines per page.  It might be used with a laser printer or
  41.              for a file designed to be printed at 8 lines per inch (88 per
  42.              page) or meant for legal or European paper sizes.
  43.  
  44.          _______         /Mn,n,n three numbers specify the margin layout: the 1st is the
  45.              left margin on odd pages (the right margin on even pages), the
  46.              2nd is the width of the text (If you don't know the width,
  47.              CountPgs will tell you), and the 3rd is the paper width, how
  48.              many columns the printer puts on a line in the font you intend
  49.              to use.  (You must begin this parameter with '/', but you can
  50.              separate the numbers with anything you like except a space.)
  51.  
  52.              "Margin" here means margin added by Prn2Both.  If there is al-
  53.              ready a margin in your text, Prn2Both won't know it, so you
  54.              must take it into account yourself, or remove it with Mangler.
  55.  
  56.          _________         /Rn,n,n,n Reverse header/footer lines on even-numbered pages.  The
  57.              first number says how many header lines and the second how
  58.              many footer lines.
  59. ________PRN2BOTH                                                             Page 2
  60.  
  61.  
  62.              If there's a third number, it will become the width (in col-
  63.              umns) of blank space that will be taken to indicate separate
  64.              header segments.  That third number also adjusts the distance
  65.              between the line ends and the left and right header segments.
  66.              (If more than so many columns are blank at either end of the
  67.              header, Prn2Both will take it there's no end segment on that
  68.              side.)  The default divider width is 4, and the end space is
  69.              always half-again the divider width (rounded down).
  70.  
  71.              If there's a fourth number, Prn2Both will use it for the head-
  72.              er width.  If there isn't a fourth number, headers will be
  73.              presumed to have the same width as the text.  By juggling the
  74.              header and divider widths, you can sometimes perform surgery
  75.              on a header line.
  76.  
  77.              On each page, Prn2Both will set out to reverse as many lines
  78.                                                      _________             as you specified, counting from the top non-blank line on the
  79.              page, but it will stop reversing on that page if it finds a
  80.              blank line first.  It does the same for footers, but counting
  81.              from the bottom non-blank line up.
  82.  
  83.              Even a file that uses headers and footers may contain pages,
  84.              like the title page, that lack them.  If Prn2Both finds no
  85.              text within 6 lines or so of either end of the page, it pre-
  86.              sumes there's no header/footer at that end of that page.  At
  87.              the top of the page, this usually works, but files paged with
  88.              FF's, usually put the FF right after the last line, whether
  89.              it's a footer line or not.  To avoid reversing the last line
  90.              of such a page, you'll have to insert some blank lines between
  91.              the last line (when it's not a footer) and the FF.
  92.  
  93.              The /R option cannot be used if the file has its own margin
  94.              built in, and you get a warning if Prn2Both finds such a mar-
  95.              gin.  If you want to reverse header lines, you should remove
  96.              the margin with Mangler.  It's a good idea to do this anyway;
  97.              it's much easier to explain to Prn2Both what margins you want
  98.              if you don't have to allow for a margin already in the text.
  99.              To find the size of the margin, use CountPgs.
  100.  
  101.          __         /N means "No split."  It puts all the output into one file,
  102.              XXX.OUT, instead of dividing it between XXX.ODD and XXX.EVN.
  103.              (This option is available from the command line, only.)
  104.  
  105.          __         /A means "Reverse All."  It reverses lines in all pages instead of
  106.              only in even-numbered ones.  You'd need to do this when the
  107.              lines are reversed wrong (reversed on odds and not on evens),
  108.              as might happen if you add or remove blank pages.  (This op-
  109.              tion is available from the command line, only.)
  110.  
  111.          __         /? cancels everything else & brings a help screen.
  112.  
  113.          Under the L# option, if the end of the file doesn't come out even
  114.          with the page length specified, Prn2Both will add blank lines to
  115.          even up the end of the last page.  In any case, if XXX.EVN has
  116.          fewer pages than XXX.ODD, Prn2Both gives it a blank extra page.
  117. ________PRN2BOTH                                                             Page 3
  118.  
  119.  
  120. Remarks: Prn2Both reads the file you specify and outputs two files with the
  121.          same filename and the suffixes ".ODD" and ".EVN".  It puts them in
  122.          the default drive\directory.  Give it C:\DOCS\FOO.DOC, and you'll
  123.          get FOO.ODD and FOO.EVN.  Essentially, you copy FOO.ODD to the
  124.          printer, take the paper out, put it in again other way up, and
  125.          copy FOO.EVN to the printer.  Be careful to make sure that the
  126.          first page in FOO.EVN (it should be the 2nd page) prints on the
  127.          back of page 1 from FOO.ODD.
  128.  
  129.          What Prn2Both does is copy from the source file into the target
  130.          files.  The only characters it notices are the line-feed (LF,
  131.          ASCII #10), form-feed (FF, ASCII #12), and end-of-file (ASCII
  132.          #26).  Whenever it finds an LF, it counts a line.  When it finds a
  133.          form-feed or counts out the page length you specified, it switches
  134.          to the other target file.  End-of-files, it nulls out. Asked to
  135.          insert margins, it will watch for bare carriage-returns (CR, ASCII
  136.          #13) and insert margin spaces after them, too.
  137.  
  138.          Except for its margining feature and its ability to reverse header
  139.          and footer lines, Prn2Both isn't a formatter or paginater.  Given
  140.          a continuous file without page divisions, Prn2Both will break it
  141.          into pages, of course, but they won't be numbered, they'll lack
  142.          headers, footers, top and bottom margins, and you take the page
  143.          breaks you get.  To print a file properly, you need to know cer-
  144.          tain things about it.  How wide are the lines, and do the pages
  145.          already have a margin built in?  That determines what printer font
  146.          you'll want and whether you should set up the printer to add a
  147.          margin.  Prn2Both doesn't give you any such information.  It's
  148.          part of a set, meant to be used together.  These are the other
  149.          programs and (briefly) what they do: (1) PrnSet is a universal
  150.          printer setter.  You need a printer setter, but any will do if it
  151.          fits your printer.  CountPgs sizes up a text file and gets the
  152.          information you need for working with it: whether the file is al-
  153.          ready paginated, the number of pages, their length & width, wheth-
  154.          er it contains tabs, bare CR's, hi-bit characters (graphics for
  155.          instance), etc.  Pagina paginate text files and make headers &/or
  156.          footers.  Finally, Mangler has a miscellany of functions you may
  157.                                                                    ____         need to massage the file into shape.  You usually need to look at
  158.          the file  to to see about headers and such, and you may need to go
  159.          in with an editor to adjust page ends and such.  For looking at
  160.          the file, several free or cheap file viewers are available; the
  161.                                         ____         best of them is Vernon Buerg's List.  The main advantage of a pro-
  162.          gram like that is that you won't inadvertenly alter the file.  If
  163.          you must use an editor, be careful.  It must be able to work with
  164.          plain ASCII files.  Further, if the file contains bare carriage
  165.          returns to make boldface and underline (CountPgs will tell you if
  166.          it does), beware of text editors that remove them or take them for
  167.          newlines.  Editors which leave CR's alone are scarcer than you'd
  168.          think.  Finally, if you want page 1 to be a right hand page, you
  169.          may need to insert some extra FF's after the title page and table
  170.          of contents.  The easy way to do it is with an editor if you have
  171.          a suitable one.  In case you don't, both Pagina and Mangler have
  172.          provision for inserting extra blank pages.
  173. ________PRN2BOTH                                                             Page 4
  174.  
  175.  
  176.          Other shareware or public domain programs also handle printing on
  177.          both sides of the page.  Two I know of are BOTH by Peter F. Feld-
  178.          mann and David Birley's BOTHSIDES.  Prn2Both began as a quick-and-
  179.          dirty job to do something they don't (or didn't when I wrote Prn2-
  180.          Both): it's usable on files which make special effects (boldface,
  181.          underline, etc.) by using bare carriage returns or by means of
  182.          special printer instruction codes inserted into the text.  The
  183.          trick is simply to divide lines on LF or FF instead of CR.
  184.  
  185.  
  186. About Margins:
  187.  
  188.          Margins for files printed on both sides of the paper are tricky.
  189.          Sometimes, you can simply center the text in the page.  Usually,
  190.          you want to leave a little more margin on the inside --the left
  191.          side of the odd pages and right of the even ones.  If you mean to
  192.          use small print and put your text onto narrow paper, you use a
  193.          normal margin on the odd pages, but you must put enough margin on
  194.          the even pages to push the text all the way over --the margin you
  195.                                              _____         really care about is the one on the right side of the even pages.
  196.          To work it out, you need to know (1) how much left margin you
  197.          want, (2) how wide the text is (CountPgs will tell you) and (3)
  198.          how wide the paper is (that is, how many characters per line the
  199.          printer will put in the font you're going to use).  Prn2Both will
  200.          ask you for these numbers and do the arithmetic for you.  You en-
  201.          ter the figures in the boxes and then press Ctrl-Enter to move
  202.          along.  It will start you with the default figures: 0 margin, 80
  203.          column text width, 80 column paper width.
  204.  
  205.          If you don't want to add margins (if you've set everything cor-
  206.          rectly with Pagina, for instance), you can just leave the default
  207.                                           _____         width values alone, provided you don't ask for reversed headers.
  208.          (In such a case, any setting will do, so long as margin = 0 and
  209.          text width = paper width.)  If you want to reverse headers or
  210.          footers, however, it's important (a) that there be no margin al-
  211.          ready in the text and usually (b) that Prn2Both know the true
  212.          width of the header (it can correct for an underestimate, but not
  213.          for an overestimate).  If either of these is incorrect, you may
  214.          get some peculiar headers.  If you call for a reversed header from
  215.          the menu, you'll be asked for the header width.
  216.  
  217.          Both Pagina and Prn2Both can make margins.  If you have an unpag-
  218.          inated file to print, you'll want to run it through Pagina, any-
  219.          way, and maybe jigger the result with an editor.  It's probably
  220.          better to do the margin making with Pagina, because you can set
  221.          them up with the rest of the header and formatting instructions in
  222.          the .HDR file.  If your file is already paginated, however, you'll
  223.          need to do the margining with Prn2Both.
  224. ________PRN2BOTH                                                             Page 5
  225.  
  226.  
  227. Sheet-Feeders & Page Order:
  228.  
  229.  
  230.          If your printer has to stack the pages print side up (e.g. HP's
  231.          Desk Jet), it will collate backwards.  Reversing the order of the
  232.          pages before printing fixes it.  Backwards backwards is forwards.
  233.  
  234.          To print on both sides of the paper, after Prn2Both has split the
  235.          file into odd and even paged files is simple enough on the usual
  236.          dot-matrix printer that uses continuous-feed paper.  If you make
  237.          sure to leave an extra sheet at the beginning of the text it's
  238.          pretty inuitive to turn the paper around so the first page of the
  239.          second file goes on the back of the first page of the first file.
  240.          With a sheet-feeder, however, it's a little tricky.
  241.  
  242.          If the printer must stack its output print side up, as the HP Desk
  243.          Jets do, printing even on one side is complicated.  A straight run
  244.          leaves you with a backwards-collated printout.  Prn2Both has no-
  245.          thing for you, of course, but Mangler can reverse the order of
  246.          pages in a file.  Stacking a reversed file print side up leaves
  247.          you with page 1 on top, facing up.  To print on both sides of the
  248.                                                 ___         paper with such a printer, reverse the odd paged file but not the
  249.          even paged file.  Print either of them, turn the paper around so
  250.          it goes in head first, and print the other file on the back.  (Re-
  251.                                            ______         member: the new print goes on the bottom of the paper as it lies
  252.          in the feeder tray).
  253.  
  254.          If the printer does collate properly by stacking the output print
  255.          side down, you don't need to reverse a file.  It is important,
  256.          however, to print the even pages first and the odd pages on the
  257.          back.
  258.  
  259.                                                               ___         I don't know of a printer that puts the print on the top of the
  260.          paper as it comes in.  If yours does, of course you'll have to re-
  261.          verse the instructions above.  More or less.
  262.  
  263.  
  264. A Note About Colors:
  265.  
  266.          PrnSet (2.80 and later) has an option to customize its colors.
  267.          (From PrnSet's main menu, press F3.)  If PRN2BOTH.EXE is on the
  268.          default drive & directory when you run PrnSet's color changer, it
  269.          will change Prn2Both's colors to match.
  270.  
  271.          Lacking a copy of PrnSet, if you know how to use DEBUG or a disk
  272.          editor (like Peter Norton's NU), you can change the bytes in the
  273.                                                           ___________         file directly.  Search for the flag, "COLORS:".  Immediately after
  274.          the colon are 4 bytes specifying colors, in this order: Normal,
  275.          Emphasized, Frame, and Reversed.  To set up for black-and-white, I
  276.          suggest you make them (in hex numbers): 07 0F 07 70 for white-on-
  277.          black, bright-white-on-black, white-on-black, black-on-white.
  278. ________PRN2BOTH                                                             Page 6
  279.  
  280.  
  281. Version History:
  282.  
  283.          1.10  (July, l989) adds margining.  Smarter & slower.
  284.  
  285.          1.20a (Aug, 1988) allows all parameters including margins to be
  286.                entered at the command line.  Smoothed interaction some.
  287.                Yes, there was a plain Prn2Both 1.20, but unfortunately, a
  288.                copy er, um, escaped prematurely.
  289.  
  290.          2.00  (Dec, 1989) allows even-page headers to be reversed.  Now
  291.                thinks lines & pp instead of chars.  Smarter & slower.
  292.  
  293.                2.00a (posthaste) fixes small bugs in output of odd lines
  294.                (bare FF's and such) & a memory management bug that caused
  295.                2.00 to refuse to run except on my (former) test files.
  296.                2.00b improves centering in headers & footers & limits head-
  297.                er and footer reversing to lines near the ends of the page.
  298.                2.00c fixes errors in paging with reversed footers and also
  299.                (I think) a nasty little intermittent loop.
  300.  
  301.          2.01  (Still Dec, 1989) adds options /A (reverse header lines on
  302.                _               All pages instead of only on even numbered ones) and /N (do
  303.                _               Not Split the file).  Another swat at that nasty little in-
  304.                termittent loop.  2.01a has a better line-reversing algo-
  305.                rithm.  Everything not abutting the line ends is clumped in-
  306.                to a single center segment.  2.01c stops better (less likely
  307.                to hang on Ctrl-Break).  2.01d (Mar, 1990) reverses properly
  308.                around a 1-chat center section.
  309.  
  310.          2.10  (Apr, 1990) (1) allows choice of divider width for header
  311.                sections, and (2) asks for header width if reverse headers
  312.                requested from the menu.  2.10a (June, 1990) fixes bug about
  313.                ragged files.  2.10c (April, 1991) makes the command line /M
  314.                and /R work properly.  (I forget what 2.10b did.)
  315.  
  316.          2.11  (Jan, 1992) Makes use of a new line-reading function.  If
  317.                all's well  you'll never notice, but changing the version
  318.                number makes it easier to keep track of bugs.
  319.  
  320.          2.20  (June, 1992)  Makes use of that function properly.  Now,
  321.                Prn2Both can handle lines of up to about 3000 characters.
  322.                Formerly, it was limited to lines of 255 characters (includ-
  323.                ing segments with underlining &c following bare CR's).  Also
  324.                has a bug fix about 0 margin specified on the command line.
  325.  
  326.          2.21  (Oct, 1992) Bug: Turbo Pascal's reset balks at read-only
  327.                non-text files.  Works around that by using text files or
  328.                temporarily changing attribute of file.  2.2la (Dec, 1992)
  329.                uses a better way to read read-only files.  2.21b (Feb,
  330.                1993) fixes bug in margins for 1-char lines.
  331.  
  332.          2.22  (July, 1993) Added help screen on /? parameter.
  333.  
  334.                                                     R. N. Wisan, July, 1993
  335.                                         37 Clinton Street, Oneonta NY 13820
  336.                                               internet: wisanr@hartwick.edu