cfdocument and cfhtmltopdf tags
cfdocument cfhtmltopdf

cfdocument supports providing username and password if the source URL is protected through BasicAuth.

No such provision in cfhtmltopdf

Cfdocumentsection tag is present

No equivalent of cfdocumentsection in cfhtmltopdf.

You can create bookmarks, for example, <cfdocument bookmark=”yes”>

No bookmark support.

Can work behind a proxy server.

Cannot work behind a proxy server.

cfhtmltopdfitem tag

In the cfhtmltopdfitem tag, we added the attribute evalAtPrint in ColdFusion (2016 release) Update 3. If set to true, then the content of cfhtmltopdfitem is evaluated after the PDF has been generated and the page numbers are available for each page. This allows you to include conditional code inside the cfhtmltopdfitem tag.

However, in cfhtmltopdf, there is limited CSS support for header and footer content. The cfhtmltopdfitem tag does not support full HTML content in header or footer of the output pdf. This tag only supports these five HTML tags: <body>, <p>, <i>, <b> and <span>.

For example, the following code works:

<cfhtmltopdf destination="c:\out\myPDF1.pdf" source="" overwrite="true"><cfhtmltopdfitem type="header">
<cfhtmltopdfitem type="pagebreak" />
<cfhtmltopdfitem type="footer">
		<p><b><i>Test footer</i></b></p>

But, for example, the following snippet, when used, throws an exception.

<cfhtmltopdfitem type="footer">
		<h1>Test footer</h1>

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License  Twitter™ and Facebook posts are not covered under the terms of Creative Commons.

Legal Notices   |   Online Privacy Policy