Example code is for an older version of Toolkit, newer code is available.
<!-- Copyright (c) 2019 ActivePDF, Inc. -->
<!-- ActivePDF Toolkit 2017 -->
<!-- Example generated 12/15/19 -->
<!-- Example uses the .NET DLL which requires -->
<!-- Coldfusion 8 or above -->
<CFSCRIPT>
// Get current path
strPath = ExpandPath(".") & "\";
// Instantiate Object
oTK = CreateObject(".NET", "APToolkitNET.Toolkit", "C:\Program Files\activePDF\Toolkit\DotNetComponent\2.0\APToolkitNET.dll");
// 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) {
Error("JPEGToPDF", intJPEGToPDF);
}
// If the image file is a TIFF file use TIFFToPDF
intTIFFToPDF = oTK.TIFFToPDF(strPath & "IMG.tif", strPath & "TIFF.pdf");
if(intTIFFToPDF != 1) {
Error("TIFFToPDF", intTIFFToPDF);
}
// Any supported image file can be converted to PDF with ImageToPDF
intImageToPDF = oTK.ImageToPDF(strPath & "IMG.jpg", strPath & "IMG.pdf");
if(intImageToPDF != 1) {
Error("ImageToPDF", intImageToPDF);
}
// Release Object
oTK = 0;
// Process Complete
WriteOutput("Done!");
// Error Handling
Function Error(method, outputCode) {
WriteOutput("Error in " & method & ": " & outputCode);
}
</CFSCRIPT>