0
Explorer
,
/t5/coldfusion-discussions/cfdocument-header-bug/td-p/138149
Sep 19, 2008
Sep 19, 2008
Copy link to clipboard
Copied
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>
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
1 Correct answer
Valorous Hero
,
Sep 19, 2008
Sep 19, 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).
Valorous Hero
,
/t5/coldfusion-discussions/cfdocument-header-bug/m-p/138150#M12769
Sep 19, 2008
Sep 19, 2008
Copy link to clipboard
Copied
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).
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
gdemaria
AUTHOR
Explorer
,
/t5/coldfusion-discussions/cfdocument-header-bug/m-p/138151#M12770
Sep 19, 2008
Sep 19, 2008
Copy link to clipboard
Copied
Thanks for checking that... I guess I need to upgrade!
I am running CF 8,0,0,176276
Will post back the results..
I am running CF 8,0,0,176276
Will post back the results..
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
gdemaria
AUTHOR
Explorer
,
/t5/coldfusion-discussions/cfdocument-header-bug/m-p/138152#M12771
Sep 19, 2008
Sep 19, 2008
Copy link to clipboard
Copied
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!
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!
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Valorous Hero
,
LATEST
/t5/coldfusion-discussions/cfdocument-header-bug/m-p/138153#M12772
Sep 19, 2008
Sep 19, 2008
Copy link to clipboard
Copied
Great. Thanks for posting the resolution!
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

