Merge PDF Documents
To merge different PDF documents to one document requires only one function call in Aloaha. Encrypted documents are automatically decrypted in order to be able to merge the files!
Please find VBS and VB6 sample code below. Note that a valid evaluation license is required to try out these samples.
VBS Sample
dim pdf
dim files
dim retval
'comma seperated list of files to be merged
files="c:\1.pdf,c:\2.pdf,c:\3.pdf"
'create object
set pdf = createobject("aloahapdf.edit")
'Merge files to target file c:\4.pdf and overwrite target file in case it exists
retval=pdf.MergeListOfPDFDocumentsSTR(files, cstr("c:\4.pdf"), true)
'display amount of merged files
msgbox retval
set pdf = nothing
VB6 sample
For the sample below to work please create a reference to the aloahapdf edit in your VB6 workbench.
Private Sub Command1_Click()
Dim dummy(0 To 2) As String
Dim target As String
Dim pdf As aloahapdf.edit
Set pdf = New aloahapdf.edit
dummy(0) = "c:\1.pdf"
dummy(1) = "c:\2.pdf"
dummy(2) = "c:\3.pdf"
target = "c:\4.pdf"
MsgBox pdf.MergeListOfPDFDocuments(dummy, target, True)
End Sub
Please ask...
Although we really tried hard, there are always questions left open. But perhaps somebody else had already put the same question?
Please check!
I can't get the pdf.MergeListOFPDFDocuments to work. When I run this Function nothing happens. The MsgBox just reutrns "0" as a text. I don't get any error though. Any Idea what could be wrong?
Hi,
please request an evaluation key for the Aloaha PDF SDK. Some APIs do NOT work without valid license key!
To request a key please send an email to info@aloaha.com
Answered 12.01.2009
If not, please do not hesitate to send us your question.
We would be glad to answer it.
Aloaha Software / Knowledge Base / PDF SDK / Merge PDF Documents