I'm having a problem trying to figure out how to get a form post to return a
PDF document using CF8. I can't seem to get CFDOCUMENT to deliver a PDF
through the form.
I have a form inside a CFDIV...
<cfdiv id="mydiv">
<cfform action="myscript.cfm" method="post">
a bunch of input fields, then...
<input type="submit" value="Generate PDF" />
</cfform>
</cfdiv>
On submit, the form makes an Ajax call sending the data to a script that
generates a PDF using CFDOCUMENT and delivers it through the browser.
However, it is not delivering the PDF. Instead, it is delivering the CODE for
the PDF into the CFDIV and trying to display the code. I tried the same form
delivering an Excel file with cfcontent and cfheader. It delivers the code
instead of the actual document.
If I take this form out of the CFDIV, everything works great.
Why can't the Ajax call made by the CFDIV functionality deliver a PDF or other
file?
GArlington - 07 Dec 2007 10:42 GMT
> I'm having a problem trying to figure out how to get a form post to return a
> PDF document using CF8. I can't seem to get CFDOCUMENT to deliver a PDF
[quoted text clipped - 21 lines]
> Why can't the Ajax call made by the CFDIV functionality deliver a PDF or other
> file?
In order for your pdf plug-in to open the document and display pdf
file (and not the code that you get) it needs to receive the
contenttype="application/pdf" in the document header. There can be
only one document header per page -> you can not display html AND
excel AND pdf all in one page. <iframe ... /> is probably your only
option here...
mostlySimple - 31 Jan 2008 04:16 GMT
I'm having the same problem...
mostlySimple - 31 Jan 2008 04:18 GMT
I'm having the same problem...
mostlySimple - 31 Jan 2008 04:18 GMT
I'm having the same problem...