Highlighted

ColdFusion 2016 Update 16 PDF / Cfcontent issue

New Here ,
Oct 05, 2020

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

Views

29

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

ColdFusion 2016 Update 16 PDF / Cfcontent issue

New Here ,
Oct 05, 2020

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

Views

30

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Oct 05, 2020 0
Adobe Community Professional ,
Oct 05, 2020

Copy link to clipboard

Copied

Could you share the cfdocument/cfcontent code?

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Oct 05, 2020 0
New Here ,
Oct 05, 2020

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

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Oct 05, 2020 0
New Here ,
Oct 05, 2020

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.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Oct 05, 2020 0
BKBK LATEST
Adobe Community Professional ,
Oct 05, 2020

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

 

 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Oct 05, 2020 0