Example code is for an older version of Toolkit, newer code is available.
# Copyright (c) 2021 ActivePDF, Inc.
# ActivePDF Toolkit 2017
# Example generated 02/27/21
require 'win32ole'
# Get current path
strPath = File.expand_path(File.dirname(__FILE__)) + "\\"
# Instantiate Object
oTK = WIN32OLE.new("APToolkit.Object")
# Create the new PDF file
intOpenOutputFile = oTK.OpenOutputFile(strPath + 'new.pdf')
if intOpenOutputFile != 0
puts "Error in OpenOutputFile: #{intOpenOutputFile}"
end
# Set whether the fields should be read only in the output PDF
# 0 leave fields as they are, 1 mark all fields as read-only
# Fields set with SetFormFieldData will not be effected
oTK.ReadOnlyOnMerge = 1
# Create array of the file paths to merge
arrayFiles = [strPath + 'cover.pdf', strPath + '5pageLI.pdf', strPath + '6pageAA.pdf']
# MergeFiles is the equivalent of calling OpenInputFile and CopyForm
# for each PDF in the attray.
intMergeFiles = oTK.MergeFiles(arrayFiles)
if intMergeFiles != 1
puts "Error in MergeFiles: #{intMergeFiles}"
end
# Close the new file to complete PDF creation
oTK.CloseOutputFile()
# Release Object
oTK = ''
# Process Complete
puts "Done!"