Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / ColdFusion / Advanced Techniques / April 2006



Tip: Looking for answers? Try searching our database.

cfdocument with pdf format never ends...

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
rbarrett2 - 26 Apr 2006 19:11 GMT
Hello,

I'm trying to output a document in pdf format using cfdocument.   However, the
page never finishes.  I eventually have to close the page manually.  

My code is as follows:

Does anyone have any ideas as to what might be wrong?

Thanks,
Robert

<cfset filename = filename & ".pdf">
<cfdocument format="pdf" filename="d:\benchmark\pdf\#filename#"
overwrite="yes">   
        <cfinclude template="OrderForm#form.ManufacturerID#.cfm">
</cfdocument>
BKBK - 28 Apr 2006 08:28 GMT
I'll suppose you realize that cfdocument simply takes a PDF "snapshot" of the
content of the tag. Hence, even if your code works, it will not display the
HTML from the included file. Take even an intuitive alternative like

<cfsavecontent variable="content">
<cfinclude template="OrderForm#form.ManufacturerID#.cfm">
</cfsavecontent>
<cfdocument format="pdf" filename="d:\benchmark\pdf\#filename#.pdf"
overwrite="yes">   
        <cfoutput>#content#</cfoutput>
</cfdocument>

It, too, will create a PDF containing the contents of the included file, and
store it in d:\benchmark\pdf\. However, as before, no content is displayed on
the current page.

The only other issue I can think of is an error in the included file. To
eliminate that possibility, verify that the following code runs

<!--- <cfset filename = filename & ".pdf"> --->
<!--- <cfdocument format="pdf" filename="d:\benchmark\pdf\#filename#"
overwrite="yes"> --->   
        <cfinclude template="OrderForm#form.ManufacturerID#.cfm">
<!--- </cfdocument> --->
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.