Skip to main content
Participant
December 5, 2016
Answered

Coldfusion10 Blank PDFs

  • December 5, 2016
  • 1 reply
  • 568 views

Hi -

I installed CF10 Enterprise on a Windows 2008 R2 Enterprise 64-bit system.

I updated with the mandatory cf10_mdt_updt.jar update

I applied Update 21 hotfix_021.jar

After installation, I used the Web Configuration Tool to remove 'All IIS Sites', and allowed the server to be restarted to complete the removal.

Then I re-added 'All IIS Sites'. This was to ensure that the wsconfig/1/isapi_redirect.dll was updated to the 8/19/2016 version.

After this, almost everything works correctly, except for PDFs. The server returns the correct number of pages, but all are blank, when I try to display this way (angle brackets removed):

cfcontent type="application/pdf" reset="yes"

                cfoutput#toString(request.printable.viewOutput)#/cfoutput

I have other code which can display PDFs, so it is not iText doing this. It might be CF cutting off binary content, which was a problem earlier in the CF10 saga, but I thought this was fixed, right? Update 21 tech notes page says that Update 21 includes all prior fixes too.

So, has anyone else seen this problem, and found a solution?

Thanks,

Ian

This topic has been closed for replies.
Correct answer WolfShade

I don't know if this will have any impact on what you are experiencing, but if you are using CFCONTENT, you don't need CFOUTPUT around your variable.

<cfcontent type="application/pdf" reset="yes" variable="<cfoutput>#toString(request.printable.viewOutput)#</cfoutput>" />

should be

<cfcontent type="application/pdf" reset="yes" variable="#toString(request.printable.viewOutput)#" />

The CFOUTPUT is implied.

HTH,

^_^

1 reply

WolfShade
WolfShadeCorrect answer
Legend
December 5, 2016

I don't know if this will have any impact on what you are experiencing, but if you are using CFCONTENT, you don't need CFOUTPUT around your variable.

<cfcontent type="application/pdf" reset="yes" variable="<cfoutput>#toString(request.printable.viewOutput)#</cfoutput>" />

should be

<cfcontent type="application/pdf" reset="yes" variable="#toString(request.printable.viewOutput)#" />

The CFOUTPUT is implied.

HTH,

^_^

Participant
December 6, 2016

Thanks for replying. Your code is much neater, but the code I showed worked in previous versions of CF, and I saw no notes that said it was not allowed.

We were doing this:

<cfcontent type="application/pdf"reset="yes">

<cfoutput>#toString(myPDFbin)#</cfoutput>

As you said, cfcontent assumes “cfoutput”, so that part is unnecessary:

<cfcontent type="application/pdf"reset="yes" variable=”#toString(myPDFbin)#” >

But…………… cfcontent expects binary data, so that “toString()” has to go as well, leaving this:

<cfcontent type="application/pdf"reset="yes" variable=”#myPDFbin#” >

And lo and behold, that worked!

THANK YOU VERY MUCH!

We will have to change quite a few files, but at least it's a simple change, and makes sense.

Thanks Again!

Ian

WolfShade
Legend
December 6, 2016

I totally flaked on the toString() thing.  But I'm glad that you got it fixed, and thank you for marking my answer correct.

V/r,

^_^