Using the cfdocument scope

When you use the cfdocument tag, ColdFusion MX creates a new scope named cfdocument. This scope contains the following variables:

currentpagenumber Displays the current page number.

totalpagecount Displays the total page count.

Note: The cfdocument scope variables are reserved for page number rendering. Do not use them in ColdFusion expressions.

You typically use these variables in a header or footer to display the current page number and total number or pages, as the following example shows:

<cfdocumentitem type= "footer> #cfdocument.currentpagenumber# of #cfdocument.totalpagecount#</cfdocumentitem>

View comments in LiveDocs