Example code is for an older version of Toolkit, newer code is available.
<!-- Copyright (c) 2021 ActivePDF, Inc. -->
<!-- ActivePDF Toolkit 2017 -->
<!-- Example generated 01/26/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");
// Check to see if the PDF is already linearized
lngLinearized = oTK.IsFileLinearized(strPath & "PDF.pdf");
// If not, then linearize the file
if(lngLinearized == false) {
intLinearizeFile = oTK.LinearizeFile(strPath & "PDF.pdf", strPath & "new.pdf", "");
if(intLinearizeFile < 0) {
Error("LinearizeFile", intLinearizeFile);
}
}
// Release Object
oTK = 0;
// Process Complete
WriteOutput("Done!");
// Error Handling
Function Error(method, outputCode) {
WriteOutput("Error in " & method & ": " & outputCode);
}
</CFSCRIPT>