<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

<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

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

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

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

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

Page orientation. Can be "landscape" or "portrait". Defaults to the orientation of the enclosing <cfdocument>.

src
string, optional

define a url or a relative path on the local system to a file that should be transferred to a pdf

srcfile
string, optional

define an absolute path to a file that should be transferred to a pdf

mimetype
string, optional

mimetype of the source (when attribute src or srcfile are defined)

name
string, optional

Bookmark name for the section

authuser
string, 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 Kerberos authentication.

authpassword
string, 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 Kerberos authentication.

useragent
string, optional

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

Examples

Simple 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