WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

OLE with Acrobat Viewer

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Append Two PDF Files Together


adobe = ObjectCreate("AcroExch.app")      ; create an application object
FirstPDF = ObjectCreate("AcroExch.pdDoc")

FirstPDFFileName = "e:\temp\a.pdf"
t1 = FirstPDF.open(FirstPDFFileName)
FirstPDF_NumPages = FirstPDF.GetNumPages()

SecondPDF = ObjectCreate("AcroExch.pdDoc")
SecondPDFFileName = "e:\temp\b.pdf"
t1 = SecondPDF.open(SecondPDFFileName)
SecondPDF_NumPages = SecondPDF.GetNumPages()			;pages start at 0


;BOOL InsertPages(long nInsertPageAfter,LPDISPATCH iPDDocSource, long nStartPage, long nNumPages,BOOL bBookmarks);
bOK = FirstPDF.InsertPages(FirstPDF_NumPages-1, SecondPDF, 0, SecondPDF_NumPages, 0)  ;insert every page
Doc1_NumPages = FirstPDF.GetNumPages()-1   ;Get the new amount of pages

;Brand new file name
t1 = FirstPDF.save(1,"e:\temp\c.pdf")

FirstPDF.close
SecondPDF.close

adobe.exit; exit the application

adobe = ""      ; close the application object
FirstPDF = ""      ; close the application object
SecondPDF = ""

exit

Article ID:   W16602
File Created: 2012:10:11:13:40:58
Last Updated: 2012:10:11:13:40:58