Copy link to clipboard
Copied
Trying to test out <cfhtmltopdf>:
<cfhtmltopdf source="http://www.google.com/" >
Or when pojnting to an html document on a local drive, nothing happens, browser is blank. When checking the application log on the CF server I get this:
Could not initialize class coldfusion.vfs.VFile
Any help would be appreciated.
Copy link to clipboard
Copied
Try
<cfhtmltopdf source="http://www.google.com/"></cfhtmltopdf>
or
<cfhtmltopdf source="http://www.google.com/"/>
In CF2018 if I don't close the tag I get a context error.
Copy link to clipboard
Copied
Good on ya for solving it, Robert.
That sure feels like a bug. If you may open a bug report (at tracker.adobe.com), it may help to get it addressed. And if you'd add the link here, others may add a vote for it (I would).
BTW, I checked and in the top 6 pages of searching the tracker for just the criteria of cfhtmltopdf in the title, none of the titles refer to this issue. There is one, from 2014, about the optional nested cfhtmltopdfitem having the same issue, and it was marked closed and not to be fixed. Still, this is technically a different issue, and whoever sees it in 2020 may have a different response to it, if you open it. That other one is here. I think it better to open a new one than to comment there.
Copy link to clipboard
Copied
Hi robert100,
I think you must use an end-tag, such as in the examples that John1231 has given. There is one good reason for <cfhtmltopdf> to have an end-tag: it is designed to be capable of enclosing a child-tag, namely, cfhtmltopdfitem.