Example code is for an older version of Toolkit, newer code is available.
<!-- Copyright (c) 2021 ActivePDF, Inc. -->
<!-- ActivePDF Toolkit 2017 -->
<!-- Example generated 01/18/21 -->
<%
Dim strPath, intJPEGToPDF, intTIFFToPDF, intImageToPDF
strPath = Server.MapPath(".") & "\"
' Instantiate Object
Set oTK = Server.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
Response.Write "Done!"
' Error Handling
Sub ErrorHandler(method, outputCode)
Response.Write("Error in " & method & ": " & outputCode)
End Sub
%>