I was just curious about the new features added in the
coldfusion 11 and I found that this is one of the great enhancement done by the
coldfusion to its pdf engine in this latest version.
CFHTMLPDF tag
Creates PDFs from HTML
How to use?
Before using the tag please note that to run/use this tag,
PDF service manager from coldfusion administrator should be enabled. When we
install coldfusion 11 by default it is enabled.
PDF service manager are configured in the ColdFusion administrator under the section - Data & Services > PDF Service
Various attributes has been provide for the tag to support
different features of PDF document.
The source for the html can be internal or external.
1. Internal HTML
Just put some html code inside the tag and run cfm page.
PDF file will be open inside the browser as we haven’t
provide the destination path inside tag.
<cfhtmltopdf>
<b>Hello WOrld !!!</b>
<i>This is the test page of
CFHTMLTOPDF</i>
<u>Created By : Dattatray
Shinde</u>
</cfhtmltopdf>
Output in the PDF format will look like as
below –
2. External Source
We can give the external site as
source for the tag.
For example –
Now following is the web page look
inside the browser –
If we use CFHTMLPDF to convert this html to
pdf then output will be as follows –
Code to generate bbc.pdf -
<cfhtmltopdf destination="bbc.pdf"
source="http://www.bbc.com/news/"
orientation="portrait"
pagetype="A4"
margintop="1"
marginbottom="1"
marginleft="1"
marginright="1">
</cfhtmltopdf>
Please take a note of the following compatibility issue
which I have not testd :P
Compatibility Issue –
The
rendering pdf engine only runs on Windows.
You
can still run this tag on a Linux or Mac, but it must connect to a remote
rendering engine running on Windows.
References –
http://cfdocs.org/cfhtmltopdf
http://tv.adobe.com/watch/adobe-coldfusion-11/enhancements-to-html-to-pdf-conversion/
Great source for the beginners. Thanks for giving the starting point.
ReplyDeleteThis tag makes input elements look great compared to . However, its CSS support is lacking. Any word on when it will support modern CSS?
ReplyDeletehtml to pdf converterHTML to PDF Converter for .NET | Select.Pdf offers a powerful html to pdf converter that can be used in any .NET application to convert any web page or raw html string to pdf
ReplyDeleteImplementing Convert HTML to PDF is a complex technique. Fortunately, I saw the author's article and benefited a lot.
ReplyDeleteThank you for taking the time and writing this post on HTML to PDF Converter. I am looking for this type of information. Great help for me!
ReplyDelete