This program is totally free to use, modify and copy as you wish,
but also no warranty of any kind.

I wrote it just to read some manuals which ps2ascii and ps2txt
just didn't managed to filter in a nice way.

Anyhow both ps2txt and ps2ascii is included so you can try them out.
Included is also a binary version of ps2term, it is compiled with
the command "gcc -static -Wall -ansi -O2 -m486 -o ps2term ps2term.c",
using gcc 2.3.3 and libc 4.3.3.


General:
  ps2term.c is a utility that strips a PostScript (.PS) file from all
  graphic stuff and prints the result (ASCII) on stdout.

  I began with hacking in the ps2txt-2.1.c file, but when just the
  original main() function was left, i decided to make it as a whole
  new program.

  This program is NOT a regular interpreter of PostScript, it's just
  extract textstrings from an PostScriptfile and at the same time it
  try's to figure out how to format the text, this is done by looking
  for certain information in the input file, the program has a number
  of switches that selects what to search for and what todo when thats
  is the case.

Usage:
  ps2term [-1p] [-2 | -2- | -2s] [-b- | -bp] [-sSTRING] [-?] [infile.ps]

  The first time you want to filter an PS file just try ps2term without
  any switches, if this works fine then theres nothing to it.

  Else if there is a lot of parantheses in the output, try the -1p
  switch, or if the outtext has strange linefeeds or miss some spaces
  between words, use -2, -2s or -2-.

  If not this fix your problem with line feeds try the -b- or -bp, in
  worst case use the -xn where n is the the maximal number of character
  allowed in a line in the outtext.

  If not even this fix a nice ASCII text from your PS-file, then you just
  have to write a new program that does, havn't you ??? :)

  If there is some strange text showing up reapeatedly in the outtext try
  to set -s<STRING> where STRING is the beginnig of the "strange" text,
  enclose the STRING with qoutes




swithes and their meaning.
---------------------------------------
  The text-strings in a Postscrip-file are placed within paranthesis,
  text formatting and other stuff is mostly placed outside the
  parantheses. The methods searches for special info outside the
  paranthesis.

 -?
   Print a short usage info on stdout.

 -2
   Search for a sequence of 2 numbers,if found and  if one of these
   numbers is greater than the numbers found in previus search, do a
   linefeed else put a space.
   Some PS files has the pairs of x,y cordinates embedded, when using
   this switch the program use these pairs to detect where to place
   linefeeds.

 -2s
   As -2 but both numbers must be greater than the numbers from the
   previus search.

 -2-
   As -2 but one of the numbers must be less than the numbers in the
   previus search. It seems as some PS files is built bottom - up,
   this switch is good for such files.


 -1p
   Just process 1 paranthes level at a time, the defalt is to process
   from found left paranthes to the last paranthes in the line.
   When this program detect a left paranthes it start to search for
   the last right paranthes on the line ( and even next line if no one
   is found) and treats all contents behind them as a text string, but
   some PS files has font info placed inbetween them and you have to
   inspect each pair of paranthesis if its text or not, this switch
   does just that.

 -b-
   Always break a line if an character is followed by a '-'. If this
   program doesn't recognize a break at end of a line this switch
   will force a break when this occures.


 -bp
   Always break a line when a  period '.' occurs.

 -sSTRING
   Supress, do not include text in parantheses that begins with STRING.

 -xn
   Force a linefeed at at most n characters in a line. If there is any
   space in the intervall n-7 and n then the linefeed will be replace
   that space else a '-' is placed after the last letter.

 If no filename is given when ps2term is started ps2term will use stdin,
 stdout is always the outfile.

 4-May-1993

 su92ban@nada.kth.se

 Bengt Andersson
 Cardellgatan 4
 112 36 Stockholm, Sweden