ActivePDF
Shopping Cart My Account Help Contact Us
Request a Call
Search
Products Solutions Support Downloads Corporate
Submit an Issue
Knowledge Base
Server Product Support
Examples & How-Tos
Support Options
Support Policies
Annual Subscription
Extensions
Documentation
Resource Links
   
 
 
 
 

HomeSupportKnowledge Base
 
activePDF KB #10544 - Simple Test using the IE Engine
activePDF KB #10544 - Simple Test using the IE Engine
Information: Example Printer Version | Return to Search
Simple Test using the IE Engine
 
Product Version Code Samples    
WebGrabber
3.5.2
VBS
VB.NET
C#
ASP
CF
PHP
 
Description
 
The following ColdFusion® example demonstrates activePDF WebGrabber's basic page grabbing functionality using the IE Engine. Refer to KB #10543 to see this example using the Native Engine. This file is required:
  • BasicIE.cfm - Code detail provided below.
Click here to download this example (includes required file):
<!--- Define Variables --->
    <!--- PDF Output Folder --->
    <CFSET varPath = ExpandPath(".")>
    
    <!--- EngineToUse (1=IE, 0=Native) --->
    <CFSET varEngine = 1>

    <!--- URL format: "http://www.activepdf.com" or "file://folder/file.htm" --->
    <CFSET varURL = "http://www.activepdf.com/support/knowledgebase/view.cfm?kb=10544&code=cf">
   
    <!--- Timeout for various calls --->
    <CFSET varTimeout = 60>
   
    <!--- For local machine use these defaults --->
    <CFSET varIP = "127.0.0.1">
    <CFSET varPort = "64320">

<!--- Instantiate Objects --->
<CFOBJECT ACTION="Create"
    TYPE="COM"
    CLASS=APWebGrabber.Object
    NAME="WG">
<CFOBJECT ACTION="Create"
    TYPE="COM"
    CLASS=APServer.Object
    NAME="APS">

<!--- Set activePDF Server properties --->
<CFSET APS.OutputDirectory = varPath>
<CFSET APS.PDFTimeout = varTimeout>

<!--- Must call before DoPrint to pass server settings to WG --->
<CFSET WG.Prt2DiskSettings = APS.ToString()>

<!--- Set WebGrabber properties --->
<CFSET WG.EngineToUse = varEngine>
<CFSET WG.URL = varURL>
<CFSET WG.TimeOut = varTimeout>
<CFSET WG.PrinterTimeout = varTimeout>

<!--- Start the conversion process --->
<CFSET varReturn = WG.DoPrint(varIP, varPort)>
<CFIF varReturn lt 0 OR varReturn gt 0>
    <CFOUTPUT>#Error("DoPrint")#</CFOUTPUT>
</CFIF>

<!--- Wait for conversion result --->
<CFSET varReturn = WG.Wait(varIP, varPort, varTimeout, "")>
<CFIF varReturn lt 19 OR varReturn gt 19>
    <CFOUTPUT>#Error("Wait")#</CFOUTPUT>
</CFIF>

<!--- Run WG CleanUp --->
<CFSET WG.Cleanup(varIP, varPort)>

<!--- Clear Objects --->
<CFSET ReleaseComObject(WG)>
<CFSET ReleaseComObject(APS)>

<!--- Error Handling --->
<CFFUNCTION name="Error">
    <CFARGUMENT name="method" required="Yes">
    <CFOUTPUT>
    '#method#' failed with a '#varReturn#'<br>
    <a href='http://www.activepdf.com/support/knowledgebase/viewKb.cfm?id=10033&tk=ts'>
    WebGrabber Return Codes KB Article</a>
    </CFOUTPUT>
    <CFSET ReleaseComObject(WG)>
    <CFSET ReleaseComObject(APS)>
    <CFABORT>
</CFFUNCTION>
 
Related Articles

  • 10545 - EngineToUse
    Instructs WebGrabber to use the 10576Native Engine or 10577IE Engine for page rendering.


  • 10025 - Adding Page Breaks
    activePDF WebGrabber gives you the ability to utilize custom page breaks to control your PDF output. The steps depend on the specified 10545EngineToUse:...


  • 10548 - Configure the WGIELogin User
    The WGIELogin user account is required to use the 10577IE Engine. During the WebGrabber process, the WG...


  • 10026 - Preserve background colors during conversion
    The steps for preserving background colors depend on the rendering engine specified by the EngineToUse property. ...


  • 10035 - WebGrabber hangs using IE Engine
    WebGrabber appears to hang when converting HTML or a webpage using the Internet Explorer Engine. The following are known symptoms that can accompany the problem:


 
Keywords
 
webgrabber, wg, simple, basic, test, example, code, run, install, won't, doesn't, php, hypertext, preprocessor, work, Internet, Explorer, IE, engine, native, default, asp, cfm, cf, coldfusion, cold, fusion, VBS, VBScript, vb, script, example
 
Last Updated 2008-04-08 Printer Version | Return to Search
 
Knowledge Base Article Feedback*
*KB article feedback ONLY (submit support issues here)
Quality of this article?
  Poor Excellent 
1 2 3 4 5 6 7 8 9 10
Is this article helpful? Yes       No       Maybe
Comments (Optional)
Email Address (Optional)
Please enter the word "PDF"
(without quotes)
 
The information in this article is for the use of activePDF Customers and Evaluation Users Only. No part of this document may be transmitted or reproduced without the express written consent of activePDF.

Copyright © 2005, activePDF, Inc. All Rights Reserved
2003 activePDF Site Map Feedback Privacy Policy Legal