I am having trouble with active PDF. Its hanging on a simple example. It
NEVER crashes or throws a page timeout exception or anything. I was
wondering if anyone could look at this and see any glaring errors.

 

<!--- Configure IP and Port numbers. --->

<cfset strIPAddress = "127.0.0.1" />

<cfset strPort = 64320 />

 

 

<!--- Configure server. --->

            

            <!--- Create the COM object for active PDF Server. --->

            <cfset comPDFServer = CreateObject("COM", "APServer.Object") />

 

            <!--- Set the output directory for the document. --->

            <cfset comPDFServer.OutputDirectory = ExpandPath("./") />

 

            <!--- Name to use for results document. --->

            <cfset comPDFServer.NewDocumentName = (GetTickCount() & ".pdf")
/>

            

            

<!--- Configure the web grabber. --->

            

            <!--- Create the COM object of the active PDF WebGrabber. --->

            <cfset comPDFGrabber = CreateObject("COM",
"APWebGrabber.Object") />

 

            <!--- Set the engine to use for the grab. 0 = Native ; 1 =
Internet Explorer. --->

            <cfset comPDFGrabber.EngineTouse = 1 />

            

            <!--- 

                        Set the URL to grab. 

                        NOTE: Even if we are streaming in html to convert to
a PDF, we still need

                        pass in a well-formed URL that will be discarded.

            --->

            <cfset comPDFGrabber.Url =
"http://www.munsch.com/news_faces.cfm"; />

            

            <!--- 

                        Set the PDF to be created from the HTML stream. Pass
in the html 

                        stream to convert to a PDF. 

            --->

            <cfset comPDFGrabber.CreateFromHTMLText = "<html><body>This is a
test for straight text</body></html>" />

 

            <!--- Pass the server settings back to the web grabber. --->

            <cfset comPDFGrabber.Prt2DiskSettings = comPDFServer.ToString()
/>

 

 

<!--- 

            Now that the PDF server the grabber are configured, it's time to
actually 

            carry out the HTML grap to PDF function. 

--->

            

<!--- Perform the web grab. --->

<cfset strPrintResults = comPDFGrabber.DoPrint(

            strIPAddress, 

            strPort

            ) />

 

 

<cfset WriteOutput("Print Results: #strPrintResults#") />

 

            

<!--- A successful return is a 0, let's check. --->

<cfif (strPrintResults NEQ 0)>

            

            <h4>

                        Could not start job, make sure WebGrabber service is
started, 

                        error: <cfset WriteOutput("#strPrintResults#") />

            </h4>

                        

<cfelse>

 

            <!--- 

                        The print has been created successfully. Now, wait
for the document 

                        to be created from the PDF. 

            --->

            <cfset strWaitResults = comPDFGrabber.Wait(

                        strIPAddress, 

                        strPort,

                        20,

                        ""

                        ) />

                        

            <cfset WriteOutput("Wait Results: #strWaitResults#") />

                                                

</cfif>

 

 

<!--- We have a created PDF, let's Pass the settings back to the Server
Object. --->

<cfset comPDFServer.FromString(comPDFGrabber.Prt2DiskSettings) />

 

 

<!--- Clean up the PDF grabber. --->

<cfset comPDFGrabber.CleanUp(

            strIPAddress, 

            strPort

            )>

            

<!--- Remove pointers to the COM objects. --->

<cfset comPDFServer = "" />

<cfset comPDFGrabber = "" />

 

 

Thanks,

Ben

.......................

Ben Nadel 

Web Developer

Nylon Technology

6 West 14th Street

New York, NY 10011

212.691.1134

212.691.3477 fax

 <http://www.nylontechnology.com> www.nylontechnology.com

 

"Always confident, seldom correct."



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:220444
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to