Ok. Got some code going. It's still in development.
The $page variable is going to be filled by reading from a csv file. This has not been implemented in the script yet.
This does require the dirlist and the printto2 udf's and the pdf split tool mentioned above.
Code:
Break on
$path = "C:\Program Files\AdultPDF\Ap PDF Split-Merge\"
$files = DIRLIST("d:\testpdf\*.pdf",2)
For Each $file in $files
$array = Split($file, "\")
$filename = SubStr($array[Ubound($array)], 1, Len($array[Ubound($array)]) -4)
?$filename
Shell $path + "pdfspme_cmd.exe -spe " + $file + " D:\testpdf\split\" + $filename
PrintTo2("D:\testpdf\split\" + $filename + $page + ".pdf","\\server\printer1")
If @ERROR = 0
Del "D:\testpdf\split\*.pdf"
Else
?@ERROR
?@SERROR
Sleep 5
Exit
EndIf
Next
I'm done with this for the evening and am going to watch some TV. Will test and edit the script some more tomorrow @ work.
_________________________
Mart
- Chuck Norris once sold ebay to ebay on ebay.