Example code is for an older version of Toolkit, newer code is available.
' Copyright (c) 2021 ActivePDF, Inc.
' ActivePDF Toolkit 2017
' Example generated 03/03/21
Dim FSO, strUniqueName, strPath, intOpenOutputFile, _
tkVer
' Get current path
Set FSO = CreateObject("Scripting.FileSystemObject")
strPath = FSO.GetFile(Wscript.ScriptFullName).ParentFolder & "\"
Set FSO = Nothing
' Instantiate Object
Set oTK = CreateObject("APToolkit.Object")
' Get the unique filename to use with OpenOutputFile
strUniqueName = oTK.GetUniqueFileName()
' Create the new PDF file
intOpenOutputFile = oTK.OpenOutputFile(strPath & strUniqueName)
If intOpenOutputFile <> 0 Then
ErrorHandler "OpenOutputFile", intOpenOutputFile
End If
' Each time a new page is required call NewPage
oTK.NewPage
' Get the current version of Toolkit and save it to print on the PDF
tkVer = oTK.ToolkitVersion
' Stamp the version onto the new page
oTK.SetFont "Helvetica", 24
oTK.PrintText 72.0, 720.0, tkVer
' Close the new file to complete PDF creation
oTK.CloseOutputFile
' Release Object
Set oTK = Nothing
' Process Complete
Wscript.Echo("Done!")
' Error Handling
Sub ErrorHandler(method, outputCode)
Wscript.Echo("Error in " & method & ": " & outputCode)
End Sub