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")
# This example will take a filled PDF form and export the data to XML
# Open the filled PDF form
intOpenInputFile = oTK.OpenInputFile(strPath + 'formx-filled.pdf')
if intOpenInputFile != 0
puts "Error in OpenInputFile: #{intOpenInputFile}"
end
# Extract the XML Data to a variable
# Use the strXMLData variable to handle the XML data
strXMLData = oTK.ExportFormAsXML('User', '')
# Close the filled PDF form
oTK.CloseInputFile()
# Release Object
oTK = ''
# Process Complete
puts "Done!"