<!-- Copyright (c) 2019 ActivePDF, Inc. --> <!-- ActivePDF Toolkit 2018 --> <!-- Example generated 12/13/19 --> <!-- 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 mark all fields read-only, 1 leave fields as they are // Fields set with SetFormFieldData will not be effected oTK.Set_ReadOnlyOnMerge(1); // Set the bookmarks from original files to copy into new PDF oTK.Set_AddBookmarks(1); // MergeFile is the equivalent of OpenInputFile and CopyForm // Merge the cover page (0 for all pages) setting first level bookmark name oTK.Set_SetInputBookmark("Cover Page"); intMergeFile = oTK.MergeFile(strPath & "cover.pdf", 0, 0); if(intMergeFile != 1) { Error("MergeFile", intMergeFile); } // Set the first level bookmark name and merge the next PDF oTK.Set_SetInputBookmark("Lorem Ipsum"); intMergeFile = oTK.MergeFile(strPath & "5pageLI.pdf", 0, 0); if(intMergeFile != 1) { Error("MergeFile", intMergeFile); } // Set the first level bookmark name and merge the next PDF oTK.Set_SetInputBookmark("Aliquam Adipiscing"); intMergeFile = oTK.MergeFile(strPath & "6pageAA.pdf", 0, 0); if(intMergeFile != 1) { Error("MergeFile", intMergeFile); } // 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>