Server 2009

ImageToPDF

Example code is for an older version of Server, newer code is available.
<!-- Copyright (c) 2020 ActivePDF, Inc. -->
<!-- ActivePDF Server 2009 -->
<!-- Example generated 01/17/20  -->

<!-- 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");

// Convert Image to PDF
// Supported image types found in Server documentation
intImageToPDF = oSVR.ImageToPDF(strPath & "IMG.jpg", strPath & "IMG.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>

Copyright © 2020 ActivePDF, Inc