Hello,
I am tyring to use ghostscript and batch to create PDFs out of WF4. I can get it to work with just the name of the file. However, I would like to do more than that. I would like to be able to ask the user for input and then add that input to the file name. Basicaly I am asking the user for the revision of the drawing and then want to add it to the drawing. I have gotten it to ask for the revision and add rev to the end of the file name, but I cannot get it to add the input.
Any help will be appreciated.
Here is the code:
rem ** For trouble shooting, remark this line
ECHO OFF
rem ** Get the plot file name and location from the command line.
rem ** Use %* to get entire line for paths with spaces
set INNAME=%*
:revno
set REVNO=
set /P REVNO=Type in Revision of drawing:
rem ** Change the .ps to .pdf for the output.
rem ** Add the year month and day to the name, e.g., 2008-06-26
rem ** set OUTNAME=%INNAME:.ps=%-%date:~10,4%-%date:~4,2%-%date:~7,2%.pdf
set OUTNAME=%INNAME:.ps=rev%REVNO%,%.pdf
rem ** set OUTNAME=%INAME:.ps=%.pdf
rem ** Start Ghostscript, make sure that "C:\Program Files\gs\gs8.60\lib" is set in your path.
rem ** For NT this is setup in: Control Panel + System + Enviroment + path.
set PATH=%PATH%;"C:\Program files\gs\gs8.63\lib";"C:\Program Files\gs\gs8.63\bin"
rem ** Ghostscript can be on a central server, with a mapped drive
rem ** Use double quotes around every veriable to handel spaces in paths
call "ps2pdf" "%INNAME%" "%OUTNAME%"
rem ** Delete the original plot file.
del "%INNAME%"
rem ** Startup Acrobat Reader with the file. Your path must contain the path to AcroRD32.exe
rem ** typically that is something like this: C:\Program Files\Adobe\Reader 8.0\Reader
start " "Acrobat.exe" "%OUTNAME%"
rem ** For trouble shooting, remove the remark on this line
rem ** PAUSE
Thank you,
Brian Toussaint
CAD Administrator
Hoshizaki America