Skip to main content
Inspiring
September 20, 2008
Answered

cfdocument header bug?

  • September 20, 2008
  • 4 replies
  • 416 views
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>
    This topic has been closed for replies.
    Correct answer -__cfSearching__-
    I ran the code with CF 8,0,1,195765 and 7,0,2,142559. The header and footers generated correctly for me (1,2,3,4).

    4 replies

    Inspiring
    September 20, 2008
    Great. Thanks for posting the resolution!
    gdemariaAuthor
    Inspiring
    September 20, 2008
    Success! Upgrading to 8.0.1 fixed the header/footer issue.
    It also seems to have really helped the layout stability of the pdf as well. Before the scaling was unpredictable and changed for each page.

    Looks much better now, thanks!
    gdemariaAuthor
    Inspiring
    September 20, 2008
    Thanks for checking that... I guess I need to upgrade!
    I am running CF 8,0,0,176276

    Will post back the results..
    -__cfSearching__-Correct answer
    Inspiring
    September 20, 2008
    I ran the code with CF 8,0,1,195765 and 7,0,2,142559. The header and footers generated correctly for me (1,2,3,4).