Creates PDFs from HTML using a WebKit based rendering engine.
<cfhtmltopdf>html</cfhtmltopdf>
cfhtmltopdf() { writeOutput(html); };
none
AES_128
RC4_40
RC4_128
RC4_128M
none
portrait
portrait
landscape
no
AllowPrinting
AllowModifyContents
AllowCopy
AllowModifyAnnotations
AllowFillIn
AllowScreenReaders
AllowAssembly
AllowDegradedPrinting
AllowSecure
All
None
letter
legal
letter
A4
A5
B4
B5
B4-JIS
B5-JIS
custom
in
in
cm
English
Put HTML inside the tags to render it as a PDF. When the destination attribute is omitted the pdf is sent back to the browser.
<cfhtmltopdf>
<h1>Hello World</h1>
</cfhtmltopdf>
Use the source attribute to specify an external url.
<cfhtmltopdf
destination="usage_example.pdf" overwrite="yes"
source="http://www.google.com/"
unit="in" pageheight="8" pagewidth="4"
pagetype="custom">
</cfhtmltopdf>
Uses the margintop, marginbottom, marginleft, marginright to set the page margins
<cfhtmltopdf destination="usage_example2.pdf"
source="http://www.google.com" overwrite="true"
orientation="portrait" pagetype="A4" margintop="1" marginbottom="1"
marginleft="1" marginright="1">
</cfhtmltopdf>
Uses the ownerpassword, encryption, and permissions attributes to produce a password encrypted pdf.
<cfhtmltopdf
source="http://www.google.com"
ownerpassword="owner" userpassword="user"
encryption="RC4_128" permissions="AllowPrinting,AllowCopy">
</cfhtmltopdf>
Signup for cfbreak
to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.