xref: /386bsd/usr/local/bin/ps2ascii (revision a2142627)
1#!/bin/sh -f
2# Extract ASCII text from a PostScript file.  Usage:
3#	ps2ascii [infile.ps [outfile.txt]]
4# If outfile is omitted, output goes to stdout.
5# If both infile and outfile are omitted, ps2ascii acts as a filter,
6# reading from stdin and writing on stdout.
7if ( test $# -eq 0 ) then
8	gs -q -dNODISPLAY -dNOBIND -dWRITESYSTEMDICT -dSIMPLE ps2ascii.ps - quit.ps
9elif ( test $# -eq 1 ) then
10	gs -q -dNODISPLAY -dNOBIND -dWRITESYSTEMDICT -dSIMPLE ps2ascii.ps $1 quit.ps
11else
12	gs -q -dNODISPLAY -dNOBIND -dWRITESYSTEMDICT -dSIMPLE ps2ascii.ps $1 quit.ps >$2
13fi
14