<!-- Copyright (c) 2021 ActivePDF, Inc. --> <!-- ActivePDF WebGrabber 2016 --> <!-- Example generated 04/11/21 --> <!-- Example uses the .NET DLL which requires --> <!-- Coldfusion 8 or above --> <CFSCRIPT> // Get current path strPath = ExpandPath(".") & "\"; // Instantiate Object oWG = CreateObject(".NET", "APWebGrabber.WebGrabber", "C:\Program Files\activePDF\WebGrabber\bin\APWebGrabber.Net35.dll"); // The below font options only work with conversions that // go through the printer or postscript file conversions // NOTE: Below font properties are IE engine only with the // exception of EmbedAllFonts which is supported in both engines // Whether to embed all fonts other than base14 fonts oWG.Set_EmbedAllFonts(true); // Whether to embed Base14 fonts oWG.Set_EmbedBase14Fonts(false); // Whether embedded fonts should be a subset oWG.Set_SubsetFonts(true); // If TrueType fonts should be substituting for the version in the // x:\windows\fonts folder oWG.Set_SubstituteTTFonts(false); // Enable extra logging (logging should only be used while troubleshooting) // C:\ProgramData\activePDF\Logs\ oWG.Set_Debug(true); // Fast web view oWG.Set_LinearizePDF(true); // Time to wait for conversion to complete (in seconds) // Set the amount of time before a request will time out oWG.Set_Timeout(40); // Margins (Top, Bottom, Left, Right) 1.0 = 1" oWG.SetMargins(0.75, 0.75, 0.75, 0.75); // 0 = Portrait, 1 = Landscape oWG.Set_Orientation(0); // Rendering engine used for the HTML // 0 = Native, 1 = IE wgEngine = CreateObject(".NET", "APWebGrabberInterface.ConversionEngine", "C:\Program Files\activePDF\WebGrabber\bin\APWebGrabber.Net35.dll"); oWG.Set_EngineToUse(wgEngine.IE); // Convert the HTML background (IE engine only) oWG.Set_PrintBackground(true); // PDF output location and filename oWG.Set_OutputDirectory(strPath); oWG.Set_NewDocumentName("metadata.pdf"); // HTML to convert // Examples: // http://domain.com/path/file.aspx // c:\folder\file.html oWG.Set_URL("http://examples.activepdf.com/samples/doc"); // Perform the HTML to PDF conversion results = oWG.ConvertToPDF(); if(results.Get_WebGrabberStatus() != "Success") { Error("ConvertToPDF", results, results.Get_WebGrabberStatus()); } // Release Object oWG = 0; // Process Complete WriteOutput("Done!"); // Error Handling Function Error(method, oResults, errorStatus) { WriteOutput("Error with " & method & ": <br/>" & errorStatus & "<br/>" & oResults.Get_details()); } </CFSCRIPT>