1 person found this helpful
If you temporarily comment out the cfhtmltopdf tag and run the page, you will see the reason for the difference. The function encodeForHTML outputs extra encodings, like
and so on.
One way to solve the problem is to use the canonicalize function, for example,
<cfoutput>With EncodeForHTML: <pre>#canonicalize(encodeForHTML(f),false,false)#</pre>
With HTMLEditFormat: <pre>#HTMLEditFormat(f)#</pre></cfoutput>
Combining functions can be overkill. Looking again at this, it could be simpler.
So...what would be the simpler way to do it? We just upgraded from CF8 to CF11, so I'm new to these functions and am just figuring out all their ramifications. I tried your canonicalize suggestion and it worked. However, if there's a simpler way, I'd like to try that before changing everything.
I would suggest you go with just one function, for example, the simpler one, HTMLEditFormat.