' Copyright (c) 2021 ActivePDF, Inc. ' ActivePDF Toolkit 2018 ' Example generated 03/03/21 Dim FSO, strPath, intJPEGToPDF, intTIFFToPDF, _ intImageToPDF ' 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 convert an image to a PDF file ' If the image is a JPEG file use JPEGToPDF intJPEGToPDF = oTK.JPEGToPDF(strPath & "IMG.jpg", strPath & "JPEG.pdf") If intJPEGToPDF < 1 Then ErrorHandler "JPEGToPDF", intJPEGToPDF End If ' If the image file is a TIFF file use TIFFToPDF intTIFFToPDF = oTK.TIFFToPDF(strPath & "IMG.tif", strPath & "TIFF.pdf") If intTIFFToPDF <> 1 Then ErrorHandler "TIFFToPDF", intTIFFToPDF End If ' Any supported image file can be converted to PDF with ImageToPDF intImageToPDF = oTK.ImageToPDF(strPath & "IMG.jpg", strPath & "IMG.pdf") If intImageToPDF <> 1 Then ErrorHandler "ImageToPDF", intImageToPDF 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