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")
# Open the template PDF
intOpenInputFile = oTK.OpenInputFile(strPath + 'form.pdf')
if intOpenInputFile != 0
puts "Error in OpenInputFile: #{intOpenInputFile}"
end
# Specify a field to return as an object
oFI = oTK.FieldInfo('name', 1)
# Get the name of the field
strName = oFI.Name
puts strName
# Get the format string of the field
strFormat = oFI.FormatString
puts strFormat
# Get the max length of the field
numMaxLength = oFI.MaxLength
puts numMaxLength
# Release Object
oFI = ''
# Finish by closing the input file
oTK.CloseInputFile()
# Release Object
oTK = ''
# Process Complete
puts "Done!"