Convert a PS file to PDF or TIF using GhostscriptTag(s): Misc Prog HowTo


PDF
Put this CMD into the root of your Ghostscript installation.

[ps2pdf.cmd]

rem
rem Convert a Postscript to a PDF 1.4
rem
rem Usage: ps2pdf.cmd input.ps [output.pdf]
rem
@echo off
rem ___________________________SETUP
set GS_HOME=%~dp0
set GSC="%GS_HOME%bin\gsc.exe"
set fileinput=%1
set cmdfile="%GS_HOME%_%~n1.rsp"
if %2/==/ (set fileoutput="%~dp1%~n1.pdf") else (set fileoutput=%2)
rem ___________________________CONVERT
echo -q -dSAFER -dNOPAUSE -dBATCH > %cmdfile%
echo -sDEVICE#pdfwrite -dCompatibilityLevel#1.4 >> %cmdfile%
echo -sOutputFile#%fileoutput% -f %fileinput% >> %cmdfile%
%GSC% @%cmdfile%
rem ___________________________CLEANUP
if exist %cmdfile% erase %cmdfile%
To convert a PDF to Postscript, see this HowTo.

TIFF
Put this CMD into the root of your Ghostscript installation.

[ps2tif.cmd]

rem
rem Convert a Postscript to a TIFF(s) single-page
rem
rem Usage: ps2tif.cmd input.ps [output.tiff]
rem
rem ___________________________SETUP
set GS_HOME=%~dp0
set GSC="%GS_HOME%bin\gsc.exe"
set fileinput=%1
set cmdfile="%GS_HOME%_%~n1.rsp"
if %2/==/ (set fileoutput="%~dp1%~n1%%d.tiff") else (set fileoutput=%2)
rem ___________________________CONVERT
echo -q -dSAFER -dNOPAUSE -dBATCH > %cmdfile%
echo -sDEVICE#tifflzw -r600 -dTextAlphaBits=4 >> %cmdfile%
echo -dGraphicsAlphaBits=4 >> %cmdfile%
echo -sOutputFile#%fileoutput% -f %fileinput% >> %cmdfile%
%GSC% @%cmdfile%
rem ___________________________CLEANUP
if exist %cmdfile% erase %cmdfile%

blog comments powered by Disqus