<cfdocumentsection>
Divides a PDF document into sections.
By using this tag in conjunction with a <cfdocumentitem> tag, each section can have unique headers, footers, and page numbers.
This tag may have a body.
This tag is also supported within <cfscript>
Requires Extension: PDF Extension for Jakarta EE (Lucee 7+)
<cfdocumentsection
marginbottom=number
marginleft=number
marginright=number
margintop=number
orientation=string
src=string
srcfile=string
mimetype=string
name=string
authUser=string
authPassword=string
userAgent=string
><!--- body --->[</cfdocumentsection>]
| Attribute | Description |
|---|---|
marginbottom
number, optional
|
edit
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
number, optional
|
edit
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
number, optional
|
edit
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. |
margintop
number, optional
|
edit
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. |
orientation
string, optional
|
edit
Page orientation. Can be "landscape" or "portrait". Defaults to the orientation of the enclosing |
src
string, optional
|
edit
define a url or a relative path on the local system to a file that should be transferred to a pdf |
srcfile
string, optional
|
edit
define an absolute path to a file that should be transferred to a pdf |
mimetype
string, optional
|
edit
mimetype of the source (when attribute src or srcfile are defined) |
name
string, optional
|
edit
Bookmark name for the section |
authUser
string, optional
|
edit
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 Kerberos authentication. |
authPassword
string, optional
|
edit
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 Kerberos authentication. |
userAgent
string, optional
|
edit
Text to put in the HTTP User-Agent request header field. Used to identify the request client software. |
Examples
editSimple Examples
<cfdocument format="pdf">
<cfdocumentsection>
<cfdocumentitem type="header">
<h2><i>Example section-1 Header</i></h2>
</cfdocumentitem>
<h1>Welcome to Lucee</h1>
<p>Example for <b>CfdocumentSection</b></p>
<h2><i>Example section-1 body</i></h2>
<cfdocumentitem type="footer">
<h2><i>Example section-1 footer</i></h2>
</cfdocumentitem>
</cfdocumentsection>
<cfdocumentsection>
<cfdocumentitem type="header">
<h2><i>Example section-2 Header</i></h2>
</cfdocumentitem>
<h2><i>Example section-2 body</i></h2>
<cfdocumentitem type="footer">
<h2><i>Example section-2 footer</i></h2>
</cfdocumentitem>
</cfdocumentsection>
</cfdocument>
See also
- PDFs
- <cfdocument>
- Search Issue Tracker open_in_new
- Search Lucee Test Cases open_in_new (good for further, detailed examples)