Why do you want to use a batch file to combine a few PDFs? What applications do the PDFs come from? How were they generated? With this information perhaps someone could offer an alternative once it was clear what you're trying to achieve.
Cheers
Ian
100's of reports each quarter ... if you want to do it manually I'll give you a job! (for no pay of course)
I am currently trying to use the filex.ps script to do it but it won't allow pathnames with spaces. Anyone know how to get around this?
Also, to do this, I have to get distiller to save the Access report as a postscript file not a PDF ... but it doesn't like it .. just keeps asking for the filename and gives a blank entry box so you have to go and type it in every time. Suggestions?
Cheers, Tony
The best way to merge some PDF files is for me to use the WinExplorer. To merge it exactly how the files are sorted you have to work as follow. 1) Sort the files in the Explorer. 2) Double-click on File1.pdf 3) Mark the files FROM LAST file to File2.PDF 4) Set the cursor over File2.PDF 5) Drag&Drop it from there on the thumbnails. That should work and it's easy.
For bigger or standard projects I work with a file-list and a VBS. The file-list I produce in my app or simply with a cmd dir statement. Attached you will find the Insert.vbs based on Acrobat SDK/IAC. More solutions (VB) you can find at PDF-zone IAC/Developer section.
HTH, Reinhard
C:\AcInsFL4.vbs
-------------------------------------
REM: Insert single/multi Pdfs into one PDF, based on a filelist-file (Datei)
REM: The "Settings.." you can change to your needs. Drag&drop for 1 filelist-file accepted.
'*********Settings in File**************************
Datei = "C:\FileList.txt" '//Filename for filelist-file (files that will be inserted)
Ask = 1 '//0=don't ask for Insert;1=ask
Bookmark = 1 '//0=Insert No bookmarks;1=Insert based on Filename
'****************************************************
set WshShell = CreateObject ("Wscript.Shell")
set fs = CreateObject("Scripting.FileSystemObject")
Set objArgs = WScript.Arguments
if objArgs.Count = 1 then Datei = ObjArgs(0)
Info = "Insert PDF-Files in Acrobat based on File-list-file."&VbCr&_
"File Name: "&Datei &" Start now?"
OK = MsgBox(Info, vbQuestion+vbYesNo,"Insert Files")
if OK = vbNo then WScript.quit
'//Start or switch to Acrobat
WshShell.run "Acrobat.exe"
While not WshShell.AppActivate("Adobe Acrobat") : Wscript.Sleep 1000 : Wend
Set gApp = CreateObject("AcroExch.App")
FLPOS = 1
if fs.FileExists(datei) then
set dateiinhalt = fs.OpenTextFile(datei)
do until dateiinhalt.atEndOfStream
inhalt = dateiinhalt.ReadLine
if not fs.FileExists(inhalt) then if MsgBox(Inhalt &vbCr &"File don't exist!") then QUIT
if Ask=1 then if MsgBox(FlPos&": "&inhalt, vbOKCancel + vbInformation) = vbCancel then exit do
'#File->Open first File
if FLPOS = 1 then
Set BASFL = CreateObject("AcroExch.pdDoc")
OK = BASFL.Open(INHALT)
if not OK Then if MsgBox("Error open Basic File") then Wscript.quit
BASFL.OpenAVDoc(mid(INHALT,InstrRev(INHALT,"\")+1))
WScript.Sleep 1000
Set avdoc = gApp.GetActiveDoc
Set pddoc = avdoc.GetPDDoc
Set jso = pddoc.GetJSObject
PageBAS = BASFL.GetNumPages-1
else
PageBAS = BASFL.GetNumPages
jso.pageNum = PageBAS+1
Set INSFL = CreateObject("AcroExch.PDDoc")
OK = INSFL.Open(INHALT)
if not OK Then if MsgBox("Error open InsertFile") then Wscript.quit
PageIns = INSFL.GetNumPages
OK = BASFL.InsertPages(PageBAS - 1,INSFL,0,PageIns,0)
INSFL.Close
jso.pageNum = PageBAS+2
end if
if Bookmark = 1 then
BMNameIE = mid(Inhalt, InstrRev(Inhalt, "\")+1)
BMNameEE = left(BMNameIE, InstrRev(BMNameIE, ".")-1)
Set BMR = JSO.BookmarkRoot
BMR.CreateChild BMNameEE, "this.pageNum = " &PageBas, PageBas
end if
FLPOS = FLPOS+1
loop
dateiinhalt.close
MsgBox " DONE!" &vbCr &"Don't forget to save the File (save as)"
else
MsgBox "Ups! " & datei & " doesn't exist? " & "Try new!", vbExclamation
end if
Sub QUIT
Set JSO=Nothing
Set PDDoc=Nothing
Wscript.quit
End sub
Aandi Inston
>I am just about to upgrade from Acrobat 4 to 5. Can i use the java Scripting
in Visual C++. I've never used it before, and do i need to create a handler
like with the acrobat functions. If so what is the name of it
Ricki, this is entirely unrelated to this topic. Please post it in a new thread.
Aandi Inston