Example code is for an older version of Toolkit, newer code is available.
# Copyright (c) 2021 ActivePDF, Inc.
# ActivePDF Toolkit 2017
# Example generated 02/26/21
require 'win32ole'
# Get current path
strPath = File.expand_path(File.dirname(__FILE__)) + "\\"
# Instantiate Object
oTK = WIN32OLE.new("APToolkit.Object")
# Toolkit can directly convert an image to a PDF file
# If the image is a JPEG file use JPEGToPDF
intJPEGToPDF = oTK.JPEGToPDF(strPath + 'IMG.jpg', strPath + 'JPEG.pdf')
if intJPEGToPDF < 1
puts "Error in JPEGToPDF: #{intJPEGToPDF}"
end
# If the image file is a TIFF file use TIFFToPDF
intTIFFToPDF = oTK.TIFFToPDF(strPath + 'IMG.tif', strPath + 'TIFF.pdf')
if intTIFFToPDF != 1
puts "Error in TIFFToPDF: #{intTIFFToPDF}"
end
# Any supported image file can be converted to PDF with ImageToPDF
intImageToPDF = oTK.ImageToPDF(strPath + 'IMG.jpg', strPath + 'IMG.pdf')
if intImageToPDF != 1
puts "Error in ImageToPDF: #{intImageToPDF}"
end
# Release Object
oTK = ''
# Process Complete
puts "Done!"