This VB6 sample uses late binding to split, merge and rotate PDF files. It is intentionally small so you can paste it into an existing project and adapt the file paths.
Before you start
- Install the trial build and register the component.
- Create the object with
CreateObject. - Set your license key before calling Split, Merge or Rotate.
- Check the return code and release the object when done.
Complete example
VB6
Private Sub Command1_Click()
Dim obj As Object
Dim iRtn As Integer
Dim iPageCount As Integer
'Create object
Set obj = CreateObject("PDFSplitMergeX.SplitMergeLib")
'Set your license key
obj.SetLicenseKey ("License Code")
'Split PDF file
iRtn = obj.Split("..\PDF-Split-Merge-ActiveX-DLL.pdf","","1,2-3,4-5,6","..\split-%d.pdf")
If iRtn = 1 Then
MsgBox "Split Successfuly."
End If
'Merge PDF file
iRtn = obj.Merge('..\split-1.pdf|..\split-2.pdf?1-1', '..\merge-1.pdf');
If iRtn = 1 Then
MsgBox "Merge Successfuly."
End If
'Get Page Count
iPageCount = obj.GetPageCount("..\PDF-Split-Merge-ActiveX-DLL.pdf", "");
Set obj = Nothing
End SubHow it works
- File lists for Merge use
|; append?1-2to select pages from a file. - Output patterns support
%dfor split files. - Use
Set obj = Nothingat the end of the operation.
During evaluation, leave the placeholder license key in place. After purchase, replace it with the key from your email.