T. Willey and I have just collaborated on a neat little postscript file combiner batch script which allows you to drag and drop files to it. Please save this code as a ``.bat'' file on your computer. You must have access to Ghostscript either installed locally or on a accessible network location.
Enjoy...
And please remember that all praise and/or monetary contributions can be directed at me (Se7en) and all criticisms may be directed at T.Willey
@echo off
:: ps_combine.bat
::
:: Given either Postscript (ps) or PDF, put all files into one PDF
:: via `drag and drop'
::
:: This batch program is meant to offer AutoCAD/Ghostscript users a
:: fast easy way to create a combined PDF production tool. It offers
:: us a way to drag and drop either pre-defined PDFs or Postscript
:: plot files.
::
:: Last Updated: 08.06.08 1:30:03 PM
::
:: A coliboration from: Se7en and T.Willey
:: theSwamp.org
::
::
:: =================================================
:: Basic variables which might need modifications
:: depending on you setup.
::
set PROG=c:\gs\gs8.61\bin\gswin32c
set OUT=%~dp1Combined.pdf
::
:: =================================================
::
:: Begin CODE
::
rem Check that we have at least one parameter
if [%1] == [] goto noparams
call :sort %*
:noparams
echo .
echo No paramaters...Exiting now.
echo .
goto endmark
:sort
:: Code cobbled from
:: Paulius Maruska
:: http://www.codeproject.com/KB/winsdk/Batch_File_Bubble_Sort.aspx
set swaps=0
set sorted=
if $%1$ == $$ goto :sort_loop_end
set var1=%1
shift
:sort_loop
if $%1$ == $$ goto :sort_loop_end
set var2=%var1%
set var1=%1
shift
set varT=%var1%
if /I %var1% LSS %var2% (
set var1=%var2%
set var2=%varT%
set /A swaps=swaps+1
)
set sorted=%sorted% %var2%
goto sort_loop
:sort_loop_end
set sorted=%sorted% %var1%
if /I %swaps% GTR 0 (
rem echo %swaps% : %sorted%
call :sort %sorted%
)
goto processargs
:processargs
call %PROG% -o %OUT% -sDEVICE=pdfwrite -f %sorted%
::
:: To force documents to the seascape orientation you can use the
:: following line. Dont forget to comment out the previous line...
::
:: call %PROG% -o %OUT% -sDEVICE=pdfwrite -c "<</Orientation 1>> setpagedevice" -f %sorted%
echo .
echo file "%OUT%" created.
echo .
goto endmark
:endmark
rem
rem finished
pause
exit
rem
::
:: End CODE
::
:: EOF