<!-- Copyright (c) 2021 ActivePDF, Inc. --> <!-- ActivePDF Server 2013 --> <!-- Example generated 04/17/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.Net35.dll"); // Path and filename of output oSVR.Set_OutputDirectory(strPath); oSVR.Set_NewDocumentName("Test.pdf"); // Start the print job results = oSVR.BeginPrintToPDF(); if(results.Get_ServerStatus() != "Success") { Error("BeginPrintToPDF", results, results.Get_ServerStatus()); } // Here is where you can print to activePDF Server to create // a PDF from any print job, set your application to print to // a static activePDF Server printer or call oSVR.NewPrinterName // to dynamically create a new printer on the fly // This example simply calls oSVR.TestPrintToPDF for testing purposes results = oSVR.TestPrintToPDF("Hello World!"); if(results.Get_ServerStatus() != "Success") { Error("TestPrintToPDF", results, results.Get_ServerStatus()); } // Wait(seconds) for job to complete results = oSVR.EndPrintToPDF(30); if(results.Get_ServerStatus() != "Success") { Error("EndPrintToPDF", results, results.Get_ServerStatus()); } // Release Object oSVR = 0; // Process Complete WriteOutput("Done!"); // Error Handling Function Error(method, oResults, errorStatus) { WriteOutput("Error with " & method & ": <br/>" & errorStatus & "<br/>" & oResults.Get_details()); } </CFSCRIPT>