Whatever message this page gives is out now! Go check it out!
<cfdocument ...>
<cfdocumentsection
authPassword = "authentication password"
authUser = "authentication user name"
marginBottom = "number"
marginLeft = "number"
marginRight = "number"
marginTop = "number"
mimeType = "text/plain|application/xmlimage/jpeg|image/png|image/bmp|image/gif"
name = "bookmark for the section"
src = "URL|path relative to web root"
srcfile = "absolute path of file"
userAgent = "HTTP user agent identifier">
HTML, CFML, and cfdocumentitem tags
</cfdocumentsection>
</cfdocument>Attribute | Req/Opt | Default | Description |
authPassword | Optional | Password sent to the target URL for Basic Authentication. Combined with username to form a base64 encoded string that is passed in the Authenticate header. Does not provide support for Integrated Windows, NTLM, or Kerebos authentication. | |
authUser | Optional | User name sent to the target URL for Basic Authentication. Combined with password to form a base64 encoded string that is passed in the Authenticate header. Does not provide support for Integrated Windows, NTLM, or Kerebos authentication. | |
marginBottom | Optional | Bottom margin in inches (default) or centimeters. To specify the bottom margin in centimeters, include the unit="cm" attribute in the parent cfdocument tag. | |
marginLeft | Optional | Left margin in inches (default) or centimeters. To specify the left margin in centimeters, include the unit="cm" attribute in the parent cfdocument tag. | |
marginRight | Optional | Right margin in inches (default) or centimeters. To specify the right margin in centimeters, include the unit="cm" attribute in the parent cfdocument tag. | |
marginTop | Optional | Top margin in inches (default) or centimeters. To specify the top margin in centimeters, include the unit="cm" attribute in the parent cfdocument tag. | |
mimeType | Optional | text/html | MIME type of the source document. Supported MIME types are:
|
name | Optional | Bookmark name for the section. | |
src | Optional | URL or the relative path to the web root. You cannot specify both the src and srcfile attributes. | |
srcfile | Optional | Absolute path of an on-disk or in-memory file that is on the server. You cannot specify both the src and srcfile attributes. | |
userAgent | Optional | ColdFusion | Text to put in the HTTP User-Agent request header field. Used to identify the request client software. |
<cfquery datasource="cfdocexamples" name="empSalary">
SELECT Emp_ID, firstname, lastname, e.dept_id, salary, d.dept_name
FROM employee e, departmt d
WHERE e.dept_id = d.dept_id
ORDER BY d.dept_name
</cfquery>
<cfdocument format="PDF">
<cfoutput query="empSalary" group="dept_id">
<cfdocumentsection>
<cfdocumentitem type="header">
<font size="-3"><i>Salary Report</i></font>
</cfdocumentitem>
<cfdocumentitem type="footer">
<font size="-3">Page #cfdocument.currentpagenumber#</font>
</cfdocumentitem>
<h2>#dept_name#</h2>
<table width="95%" border="2" cellspacing="2" cellpadding="2" >
<tr>
<th>Employee</th>
<th>Salary</th>
</tr>
<cfset deptTotal = 0 >
<!--- inner cfoutput --->
<cfoutput>
<tr>
<td><font size="-1">
#empSalary.lastname#, #empSalary.firstname#</font>
</td>
<td align="right"><font size="-1">
#DollarFormat(empSalary.salary)#</font>
</td>
</tr>
<cfset deptTotal = deptTotal + empSalary.salary>
</cfoutput>
<tr>
<td align="right"><font size="-1">Total</font></td>
<td align="right"><font size="-1">#DollarFormat(deptTotal)#</font></td>
</tr>
<cfset deptTotal = 0>
</table>
</cfdocumentsection>
</cfoutput>
</cfdocument><!--- This example uses the name attribute to define bookmarks in a PDF document at the
section level. --->
<cfdocument format="pdf" bookmark="yes">
<cfdocumentsection name="section 1">
<!--- Insert some HTML content here. --->
</cfdocumentsection>
<cfdocumentsection name="section 2">
<!--- Insert some HTML content here. --->
</cfdocumentsection>
</cfdocument>