Example code is for an older version of Toolkit, newer code is available.
<!-- Copyright (c) 2021 ActivePDF, Inc. -->
<!-- ActivePDF Toolkit 2017 -->
<!-- Example generated 03/03/21 -->
<!-- Example uses the .NET DLL which requires -->
<!-- Coldfusion 8 or above -->
<CFSCRIPT>
// Get current path
strPath = ExpandPath(".") & "\";
// Instantiate Object
oTK = CreateObject(".NET", "APToolkitNET.Toolkit", "C:\Program Files\activePDF\Toolkit\DotNetComponent\2.0\APToolkitNET.dll");
// 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.Get_Name();
WriteOutput(strName);
// Get the format string of the field
strFormat = oFI.Get_FormatString();
WriteOutput(strFormat);
// Get the max length of the field
numMaxLength = oFI.Get_MaxLength();
WriteOutput(numMaxLength);
// Finish by closing the input file
oTK.CloseInputFile();
// Release Object
oTK = 0;
// Process Complete
WriteOutput("Done!");
// Error Handling
Function Error(method, outputCode) {
WriteOutput("Error in " & method & ": " & outputCode);
}
</CFSCRIPT>