<!-- Copyright (c) 2021 ActivePDF, Inc. --> <!-- ActivePDF Toolkit 2018 --> <!-- Example generated 04/15/21 --> <% Dim strPath, intOpenOutputFile, intMergeFile strPath = Server.MapPath(".") & "\" ' Instantiate Object Set oTK = Server.CreateObject("APToolkit.Object") ' Create the new PDF file intOpenOutputFile = oTK.OpenOutputFile(strPath & "new.pdf") If intOpenOutputFile <> 0 Then ErrorHandler "OpenOutputFile", intOpenOutputFile End If ' 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.ReadOnlyOnMerge = 1 ' Set the bookmarks from original files to copy into new PDF oTK.AddBookmarks = 1 ' MergeFile is the equivalent of OpenInputFile and CopyForm ' Merge the cover page (0 for all pages) setting first level bookmark name oTK.SetInputBookmark = "Cover Page" intMergeFile = oTK.MergeFile(strPath & "cover.pdf", 0, 0) If intMergeFile <> 1 Then ErrorHandler "MergeFile", intMergeFile End If ' Set the first level bookmark name and merge the next PDF oTK.SetInputBookmark = "Lorem Ipsum" intMergeFile = oTK.MergeFile(strPath & "5pageLI.pdf", 0, 0) If intMergeFile <> 1 Then ErrorHandler "MergeFile", intMergeFile End If ' Set the first level bookmark name and merge the next PDF oTK.SetInputBookmark = "Aliquam Adipiscing" intMergeFile = oTK.MergeFile(strPath & "6pageAA.pdf", 0, 0) If intMergeFile <> 1 Then ErrorHandler "MergeFile", intMergeFile End If ' Close the new file to complete PDF creation oTK.CloseOutputFile ' Release Object Set oTK = Nothing ' Process Complete Response.Write "Done!" ' Error Handling Sub ErrorHandler(method, outputCode) Response.Write("Error in " & method & ": " & outputCode) End Sub %>