macromedia.coldfusion.cfml_general_discussion
[Top] [All Lists]

CF8 cfdocument tag has a few new bugs

Subject: CF8 cfdocument tag has a few new bugs
From: "dmf1"
Date: Fri, 24 Aug 2007 04:40:08 +0000 UTC
Newsgroups: macromedia.coldfusion.cfml_general_discussion
This discusses two new bugs in CF8 having to do with footers in cfdocument.

 ***FIRST BUG***

 With CFMX7, I could define a new footer by putting a new <cfdocumentitem 
type="footer"> tag in each cfdocumentsection of my pdf report.  Each could have 
a different string, e.g., so that the footer could tell the reader which 
chapter she is reading.  This does not work in CF8.  The chapter name that 
appears on all pages is the one defined in the last <cfdocumentitem 
type="footer"> tag in the cfdocument.  Now only the page number changes 
dynamically.  Sample code:

 <cfdocument format="pdf" unit="in" pagetype="letter" 
        marginbottom="0.8" marginleft="1" marginright="1" margintop="0.8"
        orientation="portrait" fontembed="yes" overwrite="yes"
        filename="pdfbugdemo2.pdf" pageheight="11" pagewidth="8.5" 
        scale="100">

        <cfdocumentsection>
                <cfset footerContent="1. Introduction">
                <cfdocumentitem type="footer">
                        <div style="float: left;">
                                <cfoutput>#footerContent#</cfoutput>
                        </div>
                        <div style="float: right;">
                                
<cfoutput>#cfdocument.currentpagenumber#</cfoutput>
                        </div>
                </cfdocumentitem>
                <h1>Introduction</h1>
        </cfdocumentsection>
        <cfdocumentsection>
                <cfset footerContent="2. Body of Document">
                <cfdocumentitem type="footer">
                        <div style="float: left;">
                                <cfoutput>#footerContent#</cfoutput>
                        </div>
                        <div style="float: right;">
                                
<cfoutput>#cfdocument.currentpagenumber#</cfoutput>
                        </div>
                </cfdocumentitem>
                <h1>Body of Document</h1>
        </cfdocumentsection>
 </cfdocument>

 *** SECOND BUG ***

 In CF8, you cannot cfinclude the same template multiple times in a given 
template - you get an error (at least sometimes).  A workaround is to make 
multiple copies of the template, each with a different name.  This was not 
necessary in CFMX7.  Sample code:

 <cfdocument format="pdf" unit="in" pagetype="letter" 
        marginbottom="0.8" marginleft="1" marginright="1" margintop="0.8"
        orientation="portrait" fontembed="yes" overwrite="yes"
        filename="pdfbugdemo2.pdf" pageheight="11" pagewidth="8.5" 
        scale="100">

        <cfdocumentsection>
                <cfset footerContent="1. Introduction">
                <cfinclude template="pdfbugfooter.cfm">
                <h1>Introduction</h1>
        </cfdocumentsection>
        <cfdocumentsection>
                <cfset footerContent="2. Body of Document">
                <cfinclude template="pdfbugfooter.cfm">
                <h1>Body of Document</h1>
        </cfdocumentsection>
 </cfdocument>

 where pdfbugfooter.cfm is:

 <cfdocumentitem type="footer">
        <div style="float: left;">
                <cfoutput>#footerContent#</cfoutput>
        </div>
        <div style="float: right;">
                <cfoutput>#cfdocument.currentpagenumber#</cfoutput>
        </div>
 </cfdocumentitem>
 :frown;


<Prev in Thread] Current Thread [Next in Thread>