Highlighted

Coldfusion10 Blank PDFs

New Here ,
Dec 05, 2016

Copy link to clipboard

Copied

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

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,

^_^

Views

152

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

Coldfusion10 Blank PDFs

New Here ,
Dec 05, 2016

Copy link to clipboard

Copied

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

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,

^_^

Views

153

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
Dec 05, 2016 0
LEGEND ,
Dec 05, 2016

Copy link to clipboard

Copied

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,

^_^

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...
Dec 05, 2016 0
New Here ,
Dec 06, 2016

Copy link to clipboard

Copied

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

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...
Dec 06, 2016 0
LEGEND ,
Dec 06, 2016

Copy link to clipboard

Copied

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,

^_^

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...
Dec 06, 2016 0
New Here ,
Dec 06, 2016

Copy link to clipboard

Copied

Thank you for taking the time to set me right:)

We were very worried that we would be stuck without a solution, so this is an enormous relief, even though we have to change many files. Your solution works fine with CF9 as well, so we can push this out ahead of our upgrade, which makes it even better.

Thanks Again!

Ian

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...
Dec 06, 2016 0