diff options
author | Siep Kroonenberg <siepo@cybercomm.nl> | 2008-07-04 10:17:06 +0000 |
---|---|---|
committer | Siep Kroonenberg <siepo@cybercomm.nl> | 2008-07-04 10:17:06 +0000 |
commit | 4a697a53a3c9c2795d549c7d5eb7a6c88c7911a9 (patch) | |
tree | b2f5967ce6865b615213754aa2aa3d41574502bc /Master/bin/win32 | |
parent | cdbc5d3bd4d89338a033d47d1368e8e30d273544 (diff) |
Added: epspdf conversion utility
git-svn-id: svn://tug.org/texlive/trunk@9222 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/bin/win32')
-rwxr-xr-x | Master/bin/win32/epspdf.bat | 11 | ||||
-rwxr-xr-x | Master/bin/win32/epspdf.texlua | 51 | ||||
-rwxr-xr-x | Master/bin/win32/epspdftk.bat | 11 |
3 files changed, 73 insertions, 0 deletions
diff --git a/Master/bin/win32/epspdf.bat b/Master/bin/win32/epspdf.bat new file mode 100755 index 00000000000..b203b576c3e --- /dev/null +++ b/Master/bin/win32/epspdf.bat @@ -0,0 +1,11 @@ +@echo off
+ruby -v >nul 2>&1
+if not errorlevel 1 goto doit
+echo Ruby not found. Install Ruby,
+echo get the Ruby-included version or use epstopdf.
+goto :EOF
+:doit
+setlocal
+set ownpath=%~dp0%
+texlua "%ownpath%epspdf.texlua" "%~dpn0" %*
+endlocal
diff --git a/Master/bin/win32/epspdf.texlua b/Master/bin/win32/epspdf.texlua new file mode 100755 index 00000000000..b31efa964d7 --- /dev/null +++ b/Master/bin/win32/epspdf.texlua @@ -0,0 +1,51 @@ +#! /usr/bin/env texlua + +function fixwin(args_unix) + if os.type == 'windows' then + local args_win={} -- new table + args_win[0]=args_unix[1] + for i=1, #args_unix do + args_win[i]='"'..args_unix[i]..'"' + end + return args_win + else + return args_unix + end +end + +if string.find(arg[0], '/') then -- UNIX path + basename = select(1, string.gsub(arg[1], '.*/', '')) +elseif string.find(arg[0], '\\') then -- Windows path + basename = select(1, string.gsub(arg[1], '.*\\', '')) + -- we might have \ and / mixed together ... + basename = select(1, string.gsub(basename, '.*/', '')) +else -- no path + basename = arg[1] +end + +kpse.set_program_name(basename..".bat", basename) +TLROOT=kpse.var_value('SELFAUTOPARENT') +BINDIR=kpse.var_value('SELFAUTOLOC') + +os.setenv('PATH', TLROOT..'/tlpkg/tlgs/bin;'..os.getenv('PATH')) +os.setenv('GS_LIB', TLROOT..'/tlpkg/tlgs/lib;'..TLROOT..'/tlpkg/tlgs/fonts') +os.setenv('TLROOT', TLROOT) + +script=kpse.find_file(basename..'.rb', 'texmfscripts') +command={'ruby.exe', script} + +for i=2, #arg do + command[#command+1]=arg[i] +end + +command=fixwin(command) + +--[[ Prepend an additional hyphen to activate this code. +for i=0, #command do + print (command[i]) +end +os.exit(ret) +--]] + +ret=os.spawn(command) +os.exit(ret) diff --git a/Master/bin/win32/epspdftk.bat b/Master/bin/win32/epspdftk.bat new file mode 100755 index 00000000000..d688da08ffc --- /dev/null +++ b/Master/bin/win32/epspdftk.bat @@ -0,0 +1,11 @@ +@echo off
+ruby -v >nul 2>&1
+if not errorlevel 1 goto doit
+echo Ruby not found. Install Ruby and Tcl,
+echo get the Ruby-included version or use epstopdf.
+goto :EOF
+:doit
+setlocal
+set ownpath=%~dp0%
+texlua "%ownpath%epspdf.texlua" "%~dpn0" %*
+endlocal
|