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