cfdocumentsection

Divides a PDF or FlashPaper document into sections.
By using this tag in conjunction with a cfdocumentitem
tag, each section can have unique headers, footers,
and page numbers.

  <cfdocumentsection>

 cfdocumentsection();

Attribute Reference

margintop numeric

Specifies the top margin in inches (default) or
centimeters. To specify the top margin in centimeters,
include the unit="cm" attribute in the parent cfdocument
tag.

marginbottom numeric

Specifies the 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 numeric

Specifies the 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 numeric

Specifies the right margin in inches (default) or
centimeters. To specify the right margin in centimeters,
include the unit="cm" attribute in the parent cfdocument
tag.

authpassword string

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 string

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.

mimetype string
Default: text/html

MIME type of the source document
Values:
  • text/html
  • text/plain
  • application/xml
  • image/bmp
  • image/jpeg
  • image/png
  • image/gif

name string

Bookmark name for the section.

src string

URL or the relative path to the web root. You cannot specify both the src and srcfile attributes.

srcfile string

Absolute path of a file that is on the server.
You cannot specify both the src and srcfile attributes.

useragent string

Text to put in the HTTP User-Agent request header field. Used to identify the request client software.

Examples
Sample code using the cfdocumentsection tag

We've example to create pdf with documentsection in tag syntax

<cfdocument format="pdf" bookmark="yes">
<cfdocumentsection mimetype="text/html">
<table>
<tr>
<td>Coldfusuion</td>
<td>java</td>
</tr>
</table>
</cfdocumentsection>
</cfdocument>

We've example to create pdf with documentsection in script syntax and Used documentsection mime type as text/html.

<cfscript>
cfdocument (format="pdf",bookmark="yes"){
cfdocumentsection(mimetype="text/html"){
writeOutput("<table><tr><td>Coldfusuion</td><td>java</td></tr></table>");
}
}
</cfscript>

Signup for cfbreak to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.

Fork me on GitHub