summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/scripts/tlgs/ps2ascii.lua
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/scripts/tlgs/ps2ascii.lua')
-rwxr-xr-xMaster/texmf-dist/scripts/tlgs/ps2ascii.lua39
1 files changed, 39 insertions, 0 deletions
diff --git a/Master/texmf-dist/scripts/tlgs/ps2ascii.lua b/Master/texmf-dist/scripts/tlgs/ps2ascii.lua
new file mode 100755
index 00000000000..1ce443895cd
--- /dev/null
+++ b/Master/texmf-dist/scripts/tlgs/ps2ascii.lua
@@ -0,0 +1,39 @@
+#!/usr/bin/env texlua
+--*-Lua-*-
+-- $Id$
+
+-- Copyright (C) 2008-2022 Reinhard Kotucha.
+-- You may freely use, modify and/or distribute this file.
+
+doc = {
+ invocation = '[options] <inputfile> <outputfile>',
+ synopsis = 'Extract ASCII text from a PostScript file.',
+ details = [=[
+ <inputfile> can be either a PS or PDF file. A single hyphen (-)
+ denotes stdin.
+
+ <outputfile> contains plain text. A single hyphen (-) denotes stdout.
+]=]}
+
+default_outfile_ext = '.txt'
+
+dofile(arg[0]:match('(.*[/\\]).*$')..'tlgs-common')
+
+local command = {gsname()}
+
+addto(command,
+ '-sDEVICE=txtwrite',
+ '-o'..file.output,
+ '-f',
+ file.input
+)
+
+execute(command)
+
+-- Local Variables:
+-- mode: Lua
+-- lua-indent-level: 2
+-- indent-tabs-mode: nil
+-- coding: utf-8-unix
+-- End:
+-- vim:set tabstop=2 expandtab: