summaryrefslogtreecommitdiff
path: root/sys/src/cmd/gs/lib/ps2ascii
diff options
context:
space:
mode:
authorTaru Karttunen <taruti@taruti.net>2011-03-30 15:46:40 +0300
committerTaru Karttunen <taruti@taruti.net>2011-03-30 15:46:40 +0300
commite5888a1ffdae813d7575f5fb02275c6bb07e5199 (patch)
treed8d51eac403f07814b9e936eed0c9a79195e2450 /sys/src/cmd/gs/lib/ps2ascii
Import sources from 2011-03-30 iso image
Diffstat (limited to 'sys/src/cmd/gs/lib/ps2ascii')
-rwxr-xr-xsys/src/cmd/gs/lib/ps2ascii22
1 files changed, 22 insertions, 0 deletions
diff --git a/sys/src/cmd/gs/lib/ps2ascii b/sys/src/cmd/gs/lib/ps2ascii
new file mode 100755
index 000000000..3115896d3
--- /dev/null
+++ b/sys/src/cmd/gs/lib/ps2ascii
@@ -0,0 +1,22 @@
+#!/bin/sh
+# $Id: ps2ascii,v 1.7 2004/08/04 00:55:46 giles Exp $
+# Extract ASCII text from a PostScript file. Usage:
+# ps2ascii [infile.ps [outfile.txt]]
+# If outfile is omitted, output goes to stdout.
+# If both infile and outfile are omitted, ps2ascii acts as a filter,
+# reading from stdin and writing on stdout.
+
+# This definition is changed on install to match the
+# executable name set in the makefile
+GS_EXECUTABLE=gs
+
+trap "rm -f _temp_.err _temp_.out" 0 1 2 15
+
+OPTIONS="-q -dNODISPLAY -dSAFER -dDELAYBIND -dWRITESYSTEMDICT -dSIMPLE"
+if ( test $# -eq 0 ) then
+ $GS_EXECUTABLE $OPTIONS -c save -f ps2ascii.ps - -c quit
+elif ( test $# -eq 1 ) then
+ $GS_EXECUTABLE $OPTIONS -c save -f ps2ascii.ps "$1" -c quit
+else
+ $GS_EXECUTABLE $OPTIONS -c save -f ps2ascii.ps "$1" -c quit >"$2"
+fi