<?php // Copyright (c) 2019 ActivePDF, Inc. // ActivePDF Toolkit 2018 // Example generated 12/05/19 ?> <?php // Get current path $strPath = dirname(__FILE__) . "\\"; // Instantiate Object $oTK = new COM("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) { Error("OpenInputFile", $intOpenInputFile); } // 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 = null; // Process Complete echo "Done!"; // Error Handling function Error($method, $outputCode) { echo "Error in " . $method . ": " . $outputCode; } ?>