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> --->