' Copyright (c) 2021 ActivePDF, Inc. ' ActivePDF Toolkit 2018 ' Example generated 02/25/21 Dim FSO, strPath, intDecryptPDF ' Get current path Set FSO = CreateObject("Scripting.FileSystemObject") strPath = FSO.GetFile(Wscript.ScriptFullName).ParentFolder & "\" Set FSO = Nothing ' Instantiate Object Set oTK = CreateObject("APToolkit.Object") ' Toolkit can directly encrypt an existing PDF file ' !NOTE: Evaluation keys will append 'DEMO' to the start of the password ' Remove the encryption from the specified PDF intDecryptPDF = oTK.DecryptPDF(strPath & "Encrypted.pdf", strPath & "Decrypted.pdf", "UserPassword", "OwnerPassword") If intDecryptPDF <> 0 Then ErrorHandler "DecryptPDF", intDecryptPDF End If ' Release Object Set oTK = Nothing ' Process Complete Wscript.Echo("Done!") ' Error Handling Sub ErrorHandler(method, outputCode) Wscript.Echo("Error in " & method & ": " & outputCode) End Sub