Copy link to clipboard
Copied
After installing update 16 to ColdFusion 2016, my PDF generation code has stopped working. Typically I am using cfdocument to generate the PDF, and the CFCONTENT to push it to the browser. Now I just get timeouts (error 524 via CloudFlare). Prior to the update, it was working fine and it seems other code is working fine too.
Thank you
Copy link to clipboard
Copied
Could you share the cfdocument/cfcontent code?
Copy link to clipboard
Copied
Essentially it is just this:
<cfdocument format="pdf" overwrite="yes" pagetype="letter" filename= "c:\inetpub\...\\#docId#.pdf">
My content...
</cfdocument>
<cfcontent file="c:\inetpub\...\\#docId#.pdf" deletefile="yes" type="application/pdf">
Copy link to clipboard
Copied
It seems another reboot fixed the problem. I didn't change any code so it is kind of weird that this happened though. It has never been an issue before.
Copy link to clipboard
Copied
This code contains what amounts to a contradiction. The cfdocument code tells ColdFusion to create the PDF and to save it at the location c:\inetpub\...\\#docId#.pdf. Whereas, the cfcontent code tells ColdFusion to stream the PDF to the browser and then to delete the file.
Since you don't want to keep the file, just remove the filename attribute from cfdocument. You're then left with:
<cfdocument format="pdf" pagetype="letter">
My content...
</cfdocument>
<cfheader name="Content-Disposition" value="inline;filename=doc.pdf">
<cfcontent file="c:\inetpub\...\\#docId#.pdf" deletefile="yes" type="application/pdf">