Continue to Site

Welcome to MCAD Central

Join our MCAD Central community forums, the largest resource for MCAD (Mechanical Computer-Aided Design) professionals, including files, forums, jobs, articles, calendar, and more.

drw to pdf

and.mil

New member
I have set for printing pdf file a pcf file and a batch file that use ghostscript to convert ps to pdf<br style="font-family: Verdana,Arial,Helvetica,sans-serif;">How I can modify batch file to automatically rename pdf file with the name of drw?<br style="font-family: Verdana,Arial,Helvetica,sans-serif;"><br style="font-family: Verdana,Arial,Helvetica,sans-serif;">Andrea
 
Would this help you?



@echo off
set path=C:\gs\gs8.11\lib;%path%
set path=C:\gs\gs8.11\bin;%path%
rem ** Get the plot file name and location from the command line.
set INNAME=%1


rem ** Change the .plt (Change to .ps if you are using that extension) to .pdf for the output.
set OUTNAME=%INNAME:.plt=.pdf%



rem ** Start Ghostscript
rem ** For NT this is setup in: Control Panel + System + Enviroment + path.
call C:\gs\gs8.11\lib\ps2pdf %INNAME% %OUTNAME%


rem ** Delete the original plot file.
del %INNAME%
rem ** Move the file to a release directory now.
copy %OUTNAME% j:\pdf
del %OUTNAME%
 
Hi ankarl,
I have try but the name of pdf is different to the drw name. I have gs 8.53.
The bat file that i have set is the following :
@echo off<br style="color: rgb(0, 153, 51);">set path=C:\Programmi\gs\gs8.53\lib;%path%<br style="color: rgb(0, 153, 51);">set path=C:\Programmi\gs\gs8.53\bin;%path%<br style="color: rgb(0, 153, 51);">rem ** Get the plot file name and location from the command line.<br style="color: rgb(0, 153, 51);">set INNAME=%1<br style="color: rgb(0, 153, 51);"><br style="color: rgb(0, 153, 51);">rem ** Change the .plt (Change to .ps if you are using that extension) to .pdf for the output.<br style="color: rgb(0, 153, 51);">set OUTNAME=%INNAME:.plt=.pdf%

rem ** Start Ghostscript<br style="color: rgb(0, 204, 51);">rem ** For NT this is setup in: Control Panel + System + Enviroment + path.<br style="color: rgb(0, 204, 51);">call C:\Programmi\gs\gs8.53\lib\ps2pdf %INNAME% %OUTNAME%<br style="color: rgb(0, 204, 51);"><br style="color: rgb(0, 204, 51);">rem ** Delete the original plot file.<br style="color: rgb(0, 204, 51);">del %INNAME%<br style="color: rgb(0, 204, 51);">rem ** Move the file to a release directory now.<br style="color: rgb(0, 204, 51);">copy %OUTNAME% C:\stampe<br style="color: rgb(0, 204, 51);">del %OUTNAME%

Best regard
 
How does your .pcf file look?


plotter POSTSCRIPT
paper_size_allowed A0 A1 A2 A3 A4
rotate_plotting NO default
button_name Adobe Acrobat PDF
button_help Acrobat PDF File Conversion
plot_drawing_format YES default
plot_segmented NO default
plot_roll_media NO default
plot_handshake NO default
plot_label NO default
create_separate_files yes default
plot_with_panzoom no default
pen_table_file g:\prog\locappl\proe\prolib\plotters\pen_kip_laser.pnt


allow_file_naming YES
plot_name NO
interface_quality 3 default
plot_destination file_and_printer default
plotter_command G:\Prog\locappl\proE\scripts\make-pdf.bat
plot_sheets all default
paper_outline NO default
plot_clip NO default
plot_area NO default
delete_after_plotting yes


plot_translate 0 0 mm
plot_scale 1
 
thank ankarl
It work very fine.
smiley32.gif
 

Sponsor

Back
Top