home *** CD-ROM | disk | FTP | other *** search
- /*
- * ------------------------------------
- * C R A M - the ASCII file reducer
- * ------------------------------------
- *
- * CRAM - ASCII File Reducer - V2.1
- * Copyright (c) 1988-90 - Dean Tutterow - All Rights Reserved
- *
- * What does it do? It crams as much text as possible onto a page
- * in reduced format. Using subscript characters as the font on an
- * Epson printer, you can print up to 79 characters wide and 154 rows
- * long in 2 columns. That works out to 5-6 pages of text on each
- * printed page. In normal use with files with embedded formfeeds
- * respected, you get 4 pages of text on each printed page.
- *
- * CRAM was written after I had printed another of those LONG
- * documentation files. I was tired of those STACKS of listings, etc.,
- * that gathered dust simply because they were too much trouble to
- * handle once I printed them. Now the printed listings are small
- * enough to keep in notebooks. As a bonus, CRAM is especially useful
- * for printing program listings. The reduced format is just the thing
- * to show program structure and the BIG picture!
- *
- * While not limited to Epson printers, it is hardcoded for my FX-86e.
- * Of course you can provide your own setup and un-setup codes for your
- * printer, and include them in a printer setup file for CRAM to use.
- *
- * USAGE:
- *
- * CRAM srcfile crammedfile [/options]
- *
- * where [/options] are:
- * /COLUMN=n with 1 ≤ n ≥ 10
- * /FF if <FF> encountered, align to next logical page
- * /LARGE use PICA format to get 137 characters/line
- * /PAGELENGTH=n may vary printed page length from 1-154 lines
- * /SKIP=n number of columns to ignore in srcfile
- * /WHITE=n number of characters of whitespace on left of page
- *
- * The srcfile should be a valid DOS filename; wildcards are not
- * accepted. You need only supply enough to the option name to
- * distinguish it from the other options, for example /C=1 and /R.
- *
- * As a daily VAX user, I have tried to implement the straightforward
- * command-line interface that VMS affords the user. While the srcfile
- * and crammedfile must be in that order, the options may be spread at
- * will along the command line.
- *
- * The options are much easier understood after a few practice sessions.
- * '/COLUMN=n' is used whenever you want more or less than the standard
- * two columns on each page. While normally defaulted to two-column
- * operation, only the first 79 characters on each line (unless some are
- * /SKIP-ped) are visible. '/FF' respects embedded formfeeds in the
- * text. Normally off, this option moves to the next logical page when
- * encountered. The pagelength is adjustable through '/PAGELENGTH=n'
- * The default is 132 rows, which allows two pages in each column since
- * most formatters place 66 lines per page. If you want your one-column
- * printing shifted right on the page so that you have whitespace on the
- * left side of the page, then '/WHITE' is just the ticket. Finally,
- * '/SKIP=n' ignores the first 'n' characters on each line. This allows
- * you to print 79 useful characters in each column when printing
- * formatted files with spaces or tabs in the first 'n' columns.
- */
-
- Helpful Hints:
-
- Okay, you have just un-arced one of those shiny new programs
- from the bulletin-board and you have this 80,000 byte file
- describing all of it's features, called 'SHINY.DOC'. The
- first thing to do is scan the file to see it's general format.
- The questions to ask yourself are as follows.
-
- "Are there embedded formfeeds?"
- If there are then you most likely will want to use
- the '/FF' option to align the pages.
-
- "Is there a set page length (usally 66 lines per page)?"
- Usually if a documentation file does not have embedded
- formfeeds, then it usually has a set page length. While
- this is usually 66 lines per page, it could be some
- oddball number like 63. For this case you would use the
- option '/PAGELENGTH=126' so that two pages will fit in
- each column.
-
- "Was the file created with some carriage returns not followed
- by line feeds?"
- This is the case with document processors that implement
- overstrike and other printer features in a generic manner.
- They write out a second (and possibly more) line with the
- words they want to be overstruck. Since there is no line
- feed after the first line, the printer writes over what it
- just printed. These type of files make CRAM sick! Never
- fear, FILTER is here. Included in this distribution is
- the source and executable for FILTER, a program that removes
- these subsequent lines from the document so that CRAM can
- do it's job properly. FILTER reads from STDIN and writes
- to STDOUT.
-
- "What do I do with documents spaced away from the left side of
- the page?"
- If 'SHINY.DOC' is formatted so that the first character
- on every line starts after some position other than 1,
- the '/SKIP=n' option will allow you to ignore those first
- 'n' characters on every line. When reading lines in,
- CRAM converts all tabs to their appropriate space repre-
- sentation so need to worry about them either. Using this
- option would allow you to see 'n' more characters in your
- printout
-
- "I don't have an Epson-compatible printer, am I out of luck?"
- For those of you that do not have an Epson-compatible
- printer, you may provide your own printer initialization
- and termination streams. Simply create a file called
- 'CRAM.DAT' with two lines. The first line should contain
- the binary initialization stream and the second line the
- binary termination stream. It is crude but effective.
- The printer initialization string sets the line spacing to
- 15/216 inch, selects superscript mode, and finally selects
- condensed mode. The printer termination string returns
- the printer to 1/6-inch line spacing, cancels superscript
- mode, cancels condensed mode, and finally writes an
- end-of-file character.
-
-
- I can't guarantee it, but I would wager that once you try CRAM
- you will use it to print ALL your listings and documentation
- files. One nice benefit with printing in condensed superscript
- mode is that no matter how bad your printer prints normally or
- no matter how bad your ribbon, you WILL get a nice dark, readable
- printing. A number of people have even commented that it looks
- like it came from a laser printer.
-
- I highly recommend using PKLITE, LZEXE, or any other executable
- compressor with CRAM. While the CRAM executable is not large,
- we might as well get the benefit of these programs. CRAM works
- with both mentioned executable compressors.
-
- As an advocate of shareware in general and source distribution
- in particular, I am distributing CRAM with the stipulation
- that NO fee is charged for the use, copying, or distribution
- of CRAM. I will gladly accept contributions from those that
- find my work of some use to them. Please send any suggestions,
- corrections, or contributions to the address given below.
-
- As always, this program is provided AS IS without any warranty,
- expressed or implied, including but not limited to fitness for
- a particular purpose.
-
-
- DEAN TUTTEROW
- 4706 SANTA LUCIA DR.
- WOODLAND HILLS, CA. 91364
-
-