• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

ColdFusion 2016 Update 16 PDF / Cfcontent issue

Explorer ,
Oct 05, 2020 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

110

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
community guidelines
Community Expert ,
Oct 05, 2020 Oct 05, 2020

Copy link to clipboard

Copied

Could you share the cfdocument/cfcontent code?

Votes

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
community guidelines
Explorer ,
Oct 05, 2020 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">

Votes

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
community guidelines
Explorer ,
Oct 05, 2020 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.

Votes

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
community guidelines
Community Expert ,
Oct 05, 2020 Oct 05, 2020

Copy link to clipboard

Copied

LATEST

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

 

 

Votes

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
community guidelines
Resources
Documentation