Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Combining PDF

169 views
Skip to first unread message

Dave Tracy

unread,
Jun 13, 2003, 8:27:46 AM6/13/03
to
Hello,
I'm a new user, is there a way to combine 2 or more PDF files in a bat file program. file1.pdf+file2.pdf file3.pdf....
THanks....
...Dave Tracy
David...@nielsenmedia.com

Gerry Heinemann

unread,
Jun 13, 2003, 4:14:51 PM6/13/03
to
Using Acrobat, not that I know of.
Gerry

Ian Burton

unread,
Jun 13, 2003, 5:04:25 PM6/13/03
to
I think you can do this in just a few clicks in Acrobat. Then you should also
consider something I saw at an Acrobat 6 demo, select all the application/data files you want to combine in a PDF and send them all together to the distiller. This looked great in the demo of an executive putting Word, Excel, Project, and AutoCAD files all in one PDF with just one action.

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

Tony Grimes

unread,
Jul 15, 2003, 2:22:35 AM7/15/03
to
I am trying to combine PDF files generated by MS Access via Distiller, need to combine the separate pages into a single report but via a Access VBA program not manually.

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

Reinhard Franke

unread,
Jul 15, 2003, 4:06:38 AM7/15/03
to
To Tony ... here you can find a solution to produce/print PDF-files without user action. Perhaps you can change it for PS-files: Reinhard Franke "convert a file to a .PDF" 4/15/03 3:11am </cgi-bin/webx?14@@.1de87086/5>

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

Ricki Patel

unread,
Jul 21, 2003, 6:20:16 AM7/21/03
to
what version of acrobat, and what is JSO

Ricki Patel

unread,
Jul 21, 2003, 6:08:20 AM7/21/03
to
what version of acrobat are you using for this and what is JSO

Aandi Inston

unread,
Jul 21, 2003, 6:25:03 AM7/21/03
to
JSO is the method of running JavaScript commands from VB, introduced
in Acrobat 5.0. Described in the Acrobat SDK.

Aandi Inston

Ricki Patel

unread,
Jul 21, 2003, 7:17:25 AM7/21/03
to

Ricki Patel

unread,
Jul 21, 2003, 12:25:36 PM7/21/03
to
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

Suzanne Cole

unread,
Jul 21, 2003, 12:32:03 PM7/21/03
to

>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.

Ricki Patel

unread,
Jul 22, 2003, 4:18:39 AM7/22/03
to
I'm relating this to this topic because my aim is to merge or combine PDF. In VB you use the JSObject to create bookmarks for each document that has been merged. I didn't make myself clear but it's all to do with combining multiple PDFs together.

Aandi Inston

unread,
Jul 22, 2003, 4:51:22 AM7/22/03
to
Ok, so far as I know the JSObject only works with VB.

Aandi Inston

0 new messages