Example code is for an older version of Toolkit, newer code is available.
<?php
// Copyright (c) 2021 ActivePDF, Inc.
// ActivePDF Toolkit 2016
// Example generated 02/26/21
?>
<?php
// Get current path
$strPath = dirname(__FILE__) . "\\";
// Instantiate Object
$oTK = new COM("APToolkit.Object");
// Open the template PDF
$intOpenInputFile = $oTK->OpenInputFile($strPath . "form.pdf");
if ($intOpenInputFile != 0) {
Error("OpenInputFile", $intOpenInputFile);
}
// Specify a field to return as an object
$oFI = $oTK->FieldInfo("name", 1);
// Get the name of the field
$strName = $oFI->Name;
echo $strName;
// Get the format string of the field
$strFormat = $oFI->FormatString;
echo $strFormat;
// Get the max length of the field
$numMaxLength = $oFI->MaxLength;
echo $numMaxLength;
// Release Object
$oFI = null;
// Finish by closing the input file
$oTK->CloseInputFile();
// Release Object
$oTK = null;
// Process Complete
echo "Done!";
// Error Handling
function Error($method, $outputCode) {
echo "Error in " . $method . ": " . $outputCode;
}
?>