Answered
cfdocument header bug?
Is this a bug?
cfdocumentsection is supposed to have their own header and footer. This example mimics one in the documentation. I loop through a simple counter from 1 to 4 and name each page, header and footer with the loop number. But if you run this simple code, 4 pages of a PDF will be created, the pages will be 1 to 4, but every pages' header and footer will say "5" on it..
<cfdocument pagetype="letter"
format="pdf"
filename="#variables.filePath#" overwrite="true"
>
<cfloop index="ctr" from="1" to="4">
<cfdocumentsection>
<cfoutput><h1>Page #ctr#</h1></cfoutput>
<cfdocumentitem type="header">
<cfoutput>Header #ctr#</cfoutput>
</cfdocumentitem>
<cfdocumentitem type="footer">
<cfoutput>Footer #ctr#</cfoutput>
</cfdocumentitem>
</cfdocumentsection>
</cfloop>
</cfdocument>
cfdocumentsection is supposed to have their own header and footer. This example mimics one in the documentation. I loop through a simple counter from 1 to 4 and name each page, header and footer with the loop number. But if you run this simple code, 4 pages of a PDF will be created, the pages will be 1 to 4, but every pages' header and footer will say "5" on it..
<cfdocument pagetype="letter"
format="pdf"
filename="#variables.filePath#" overwrite="true"
>
<cfloop index="ctr" from="1" to="4">
<cfdocumentsection>
<cfoutput><h1>Page #ctr#</h1></cfoutput>
<cfdocumentitem type="header">
<cfoutput>Header #ctr#</cfoutput>
</cfdocumentitem>
<cfdocumentitem type="footer">
<cfoutput>Footer #ctr#</cfoutput>
</cfdocumentitem>
</cfdocumentsection>
</cfloop>
</cfdocument>
