Navigation:  DominoPDF > Sample Code >

DominoPDF - Merging PDF Example

Previous pageReturn to chapter overviewNext page

If more than one PDF file is created but ideally they need to be in a single PDF file the DomPDFMerge function can be used.

Create an agent in Notes and place the following code in the (Declarations) section of the agent.

Declare Function DomPDFMerge Lib "DOMINOPDF.DLL" (Byval szInput As String, Byval szOutput As String) As Long

In the Initialize section place the code to merge the PDF files together. DomPDFMerge accepts a semi-colon (;) delimited list of existing PDF file names to be merged and the PDF file name to be used as the merged file.

Sub Initialize

'Declare variables...

Dim sInput As String, sOutput As String

 

'Set values...

sInput = |c:\test.PDF;c:\test2.PDF|

sOutput = |c:\merged.pdf|

 

'Error handler...

On Error Goto Error_Handler

 

'Merge PDF files...

Call DomPDFMerge(sInput, sOutput)

 

The_End:

Exit Sub

 

Error_Handler:

Print Error$

Resume The_End

End Sub