File: ps2pdf.bat

package info (click to toggle)
gs 5.10-10.1
  • links: PTS
  • area: main
  • in suites: potato
  • size: 14,960 kB
  • ctags: 25,299
  • sloc: ansic: 164,376; makefile: 3,020; cpp: 2,237; sh: 1,219; asm: 684; tcl: 434; perl: 56
file content (62 lines) | stat: -rw-r--r-- 1,393 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
@echo off
rem Convert PostScript to PDF.

rem	NOTE: for questions about using this file on Windows NT, please
rem	contact Matt Sergeant (sergeant@geocities.com).

set PS2PDFPARAMS=-q -dNOPAUSE -dBATCH -sDEVICE#pdfwrite
set PS2PDFOPT=

if "%OS%"=="Windows_NT" goto nt

rem	Run ps2pdf on any Microsoft OS.  The executable must be named gs.

set PS2PDFGS=gs

:run
if "%1"=="" goto usage
if "%2"=="" goto usage
:opt
if "%3"=="" goto exec
set PS2PDFOPT=%PS2PDFOPT% %1
shift
goto opt

:exec
rem Watcom C deletes = signs, so use # instead.
rem Doing an initial 'save' helps keep fonts from being flushed between pages.
%PS2PDFGS% %PS2PDFPARAMS% %PS2PDFOPT% -sOutputFile#%2 -c save pop -f %1
goto end

:usage
echo "Usage: ps2pdf [options...] input.ps output.pdf"
goto end

rem	Run ps2pdf on Windows NT.  The executable must be named gswin32c.

:nt
set PS2PDFGS=gswin32c
if not CMDEXTVERSION 1 goto run
if "%1"=="" goto ntusage
if "%2"=="" goto nooutfile
if not "%3"=="" goto opt

rem Watcom C deletes = signs, so use # instead.
%PS2PDFGS% %PS2PDFPARAMS% -sOutputFile#%2 -c save pop -f %1
goto end

:ntusage
echo "Usage: ps2pdf input.ps [output.pdf]"
echo "   or: ps2pdf [options...] input.ps output.pdf"
goto end

:nooutfile
set PS2PDF=%1
set PS2PDF=%PS2PDF:.PS=.PDF%
%PS2PDFGS% %PS2PDFPARAMS% -sOutputFile#%PS2PDF% -c save pop -f %1

:end
rem	Clean up.
SET PS2PDFPARAMS=
SET PS2PDFGS=
SET PS2PDFOPT=