summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/scripts/tlgs/gswin32/pdf2dsc.tlu
diff options
context:
space:
mode:
authorReinhard Kotucha <reinhard.kotucha@web.de>2015-05-05 21:26:28 +0000
committerReinhard Kotucha <reinhard.kotucha@web.de>2015-05-05 21:26:28 +0000
commitc51296e843e35a3d133557000409674baae01b54 (patch)
tree571fdfb2f2660b3c7d6bd5d522a1268a776f8ab4 /Master/texmf-dist/scripts/tlgs/gswin32/pdf2dsc.tlu
parentfe576e3d01b31dbc35e1bc4008052c06c47d3cf3 (diff)
texlua scripts revised
pdfopt.tlu is using -dFastWebView now instead of pdfopt.ps git-svn-id: svn://tug.org/texlive/trunk@37204 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/scripts/tlgs/gswin32/pdf2dsc.tlu')
-rwxr-xr-xMaster/texmf-dist/scripts/tlgs/gswin32/pdf2dsc.tlu32
1 files changed, 23 insertions, 9 deletions
diff --git a/Master/texmf-dist/scripts/tlgs/gswin32/pdf2dsc.tlu b/Master/texmf-dist/scripts/tlgs/gswin32/pdf2dsc.tlu
index 25921db23ea..5a6cd479a7e 100755
--- a/Master/texmf-dist/scripts/tlgs/gswin32/pdf2dsc.tlu
+++ b/Master/texmf-dist/scripts/tlgs/gswin32/pdf2dsc.tlu
@@ -21,13 +21,22 @@ function fixwin (args_unix)
end
end
-if os.type == 'windows' then
- gs='gswin32c'
-else
- gs='gs'
+
+local function push (t, ...)
+ local args={...}
+ for _,v in ipairs(args) do
+ if type(v) == 'table' then
+ for _,x in ipairs(v) do
+ t[#t+1]=x
+ end
+ else
+ t[#t+1]=v
+ end
+ end
end
-if #arg == 0 or #arg > 2 then
+
+if #arg ~= 2 then
io.stderr:write('Usage: pdf2dsc input.pdf [output.dsc]\n')
os.exit(1)
end
@@ -39,9 +48,14 @@ else
dscfile=string.gsub(pdffile, '%.%a+$', '.dsc')
end
-command={gs, '-q', '-dNODISPLAY', '-dSAFER', '-dDELAYSAFER',
- '-sPDFname='..pdffile, '-sDSCname='..dscfile, 'pdf2dsc.ps',
- '-c', 'quit'}
+-- setup command
+
+local command={}
+if os.type == 'unix' then command={'gs'} else command={'gswin32c'} end
+
+push(command, '-q', '-dNODISPLAY', '-dSAFER', '-dDELAYSAFER',
+ '-sPDFname='..pdffile, '-sDSCname='..dscfile, 'pdf2dsc.ps',
+ '-c', 'quit')
command=fixwin(command)
@@ -49,7 +63,7 @@ command=fixwin(command)
for i=0, #command do
print (command[i])
end
-os.exit(ret)
+os.exit(0)
--]]
ret=os.spawn(command)