Example code is for an older version of Server, newer code is available.
<!-- Copyright (c) 2021 ActivePDF, Inc. -->
<!-- ActivePDF Server 2009 -->
<!-- Example generated 03/03/21 -->
<!-- Example uses the .NET DLL which requires -->
<!-- Coldfusion 8 or above -->
<CFSCRIPT>
// Get current path
strPath = ExpandPath(".") & "\";
// Instantiate Object
oSVR = CreateObject(".NET", "APServer.Server", "C:\Program Files\activePDF\Server\bin\APServer.dll");
// Enable extra logging in the activepdflogs folder
oSVR.Set_DebugMode(true);
// Convert Image to PDF
// Supported image types found in Server documentation
intImageToPDF = oSVR.ImageToPDF(strPath & "IMG.jpg", strPath & "Debug.pdf", 0, 0, true, true, 72, "", 0, 0);
if(intImageToPDF != 0) {
Error("ImageToPDF", intImageToPDF);
}
// Release Object
oSVR = 0;
// Process Complete
WriteOutput("Done!");
// Error Handling
Function Error(method, outputCode) {
WriteOutput("Error in " & method & ": " & outputCode);
}
</CFSCRIPT>