DocumentItem
Component which specifies header, footer, and pagebreaks within a document body
This component is available in the free-tier functionality of this module
Component Signature
<bx:DocumentItem type=[string]
evalAtPrint=[string] />Attributes
Atrribute
Type
Required
Description
Default
type
string
false
string pagebreak
header
evalAtPrint
string
false
A boolean which determines if the contents of the cfdocumentitem tag body has to be evaluated at the time of printing the document. This attribute is deprecated as all content is evaluated at print time.
true
Examples
Document Header
<bx:document format="pdf" filename="header-example.pdf">
<!-- Global Header -->
<bx:documentitem type="header">
<div style="text-align: center; border-bottom: 2px solid #333; padding: 10px;">
<h2>Company Annual Report</h2>
<p>Confidential - Internal Use Only</p>
</div>
</bx:documentitem>
<h1>Document Content</h1>
<p>This content will appear on every page with the header above.</p>
</bx:document>Document Footer
Page Break
Combined Header, Footer, and Page Breaks
Built-in Variables
When using DocumentItem components, BoxLang provides special variables:
#bxdocument.currentpagenumber#- Current page number#bxdocument.totalpages#- Total number of pages in the document
Related Components
Document - Main component for PDF generation
DocumentSection - Divides documents into sections
Last updated
Was this helpful?
