<!-- Copyright (c) 2021 ActivePDF, Inc. --> <!-- ActivePDF Toolkit 2018 --> <!-- Example generated 03/07/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"); // Create the new PDF file intOpenOutputFile = oTK.OpenOutputFile(strPath & "new.pdf"); if(intOpenOutputFile != 0) { Error("OpenOutputFile", intOpenOutputFile); } // Set whether the fields should be read only in the output PDF // 0 leave fields as they are, 1 mark all fields as read-only // Fields set with SetFormFieldData will not be effected oTK.Set_ReadOnlyOnMerge(1); // Create array of the file paths to merge arrayFiles = [strPath & "cover.pdf", strPath & "5pageLI.pdf", strPath & "6pageAA.pdf"]; // MergeFiles is the equivalent of calling OpenInputFile and CopyForm // for each PDF in the attray. intMergeFiles = oTK.MergeFiles(arrayFiles); if(intMergeFiles != 1) { Error("MergeFiles", intMergeFiles); } // Close the new file to complete PDF creation oTK.CloseOutputFile(); // Release Object oTK = 0; // Process Complete WriteOutput("Done!"); // Error Handling Function Error(method, outputCode) { WriteOutput("Error in " & method & ": " & outputCode); } </CFSCRIPT>