User Guide

Table Of Contents
Creating PDF and FlashPaper output with the cfdocument tag 765
Creating basic reports from HTML and CFML
You can convert HTML-based reports into PDF or FlashPaper output by wrapping the HTML in
the
cfdocument start and end tags, and specifying cfdocument attributes, as appropriate, to
customize the following items:
Page size
Page orientation
Margins
Encryption (PDF only)
User password and owner password (PDF only)
Permissions (PDF only)
For complete information on these options, see the
cfdocument tag discussion in CFML Reference.
Note: Embedding fonts in the report can help ensure consistent display across multiple browsers and
platforms. For more information on the considerations related to embedding fonts, see “Font
management with printable reports” on page 804.
The following example displays a list of employees, using a cfoutput tag to loop through the
query:
<cfdocument format="flashpaper">
<h1>Employee List</h1>
<!--- Inline query used for example purposes only --->
<cfquery name="EmpList" datasource="cfdocexamples">
SELECT FirstName, LastName, Salary, Contract
FROM Employee
</cfquery>
<cfoutput query="EmpList">
#EmpList.FirstName#, #EmpList.LastName#, #LSCurrencyFormat(EmpList.Salary)#,
#EmpList.Contract#<br>
</cfoutput>
</cfdocument>
Creating sections, headers, and footers
You can use the
cfdocumentitem and cfdocumentsection tags to fine-tune your printable
output, as follows:
cfdocumentitem Creates page breaks, headers, or footers.
cfdocumentsection Divides output into sections, optionally specifying custom margins.
Within a section, use the
cfdocumentitem tag to specify unique headers and footers for each
section.