procedure TForm1.Button1Click(Sender: TObject);
var
obj: OleVariant;
iRtn, iPageCount: Integer;
begin
//Create object
obj := CreateOleObject('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
begin
ShowMessage('Split Successfuly.');
end;
//Merge PDF file
iRtn:= obj.Merge('..\split-1.pdf|..\split-2.pdf?1-1', '..\merge-1.pdf');
if iRtn = 1 then
begin
ShowMessage('Merge Successfuly.');
end;
//Get Page Count
iPageCount:= obj.GetPageCount('..\PDF-Split-Merge-ActiveX-DLL.pdf', '');
Obj := Unassigned;
end;