<!-- Copyright (c) 2021 ActivePDF, Inc. --> <!-- ActivePDF Server 2013 --> <!-- Example generated 04/14/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"); // Stamp Images and Text onto the output PDF oSVR.AddStampCollection("TXTinternal"); oSVR.Set_StampFont("Helvetica"); oSVR.Set_StampFontSize(108); oSVR.Set_StampFontTransparency(0.1); oSVR.Set_StampRotation(45.0); wgFillMode = CreateObject(".NET", "ADK.PDF.FontFillMode", "C:\Program Files\activePDF\WebGrabber\bin\APWebGrabberProxy.dll,C:\Program Files\activePDF\WebGrabber\bin\APWebGrabber.Net35.dll"); oSVR.Set_StampFillMode(wgFillMode.FillThenStroke); oSVR.SetStampColor(255, 0, 0, 0); oSVR.SetStampStrokeColor(100, 0, 0, 0); oSVR.AddStampText(116.0, 156.0, "Internal Only"); oSVR.AddStampCollection("IMGimage"); oSVR.AddStampImage(strPath & "logo.png", 508.0, 16.0, 32.0, 32.0, true); // Set whether the stamp collection(s) appears in the background or foreground oSVR.Set_StampBackground(0); // Path and filename of output oSVR.Set_OutputDirectory(strPath); oSVR.Set_NewDocumentName("stamped.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()); } // If there will be multiple conversions in the same instance // you can clear the stamp collections or remove one individually // in order to change what is stamped on the next conversion oSVR.RemoveStampCollection("TXTinternal"); oSVR.ClearStampCollections(); // 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>