Categories

Partners


  • Free Flash Website

  • Website Templates

  • Adobe Photoshop Tutorials

  • Bittorent and
    Google desktop programs

  • Free Stock Photos and Images

  • Adobe Photoshop Tutorials

  • Photoshop, Flash, 3dsmax tutorials
  • Search


    Advanced Search




    Subscribe

    Code Examples for the cfdocument Tag
    Published  06/28/2006 | Macromedia FlashPaper
       




    Code Examples for the cfdocument Tag

    There are a few additional supporting subset tags for the cfdocument tag: cfdocumentitem and cfdocumentsection. These two tags provide additional format control.

    The cfdocumentitem tag has three different attributes: header, footer, and pagebreak. Their attribute names indicate their functionality. The header and footer attribute values support document headers and footers, while the pagebreak attribute value specifies an inserted page break in the document (see Code Example 1).

    Code Example 1: Using the cfdocument tag with the supporting cfdocumentitem tag

    <cfdocument format="pdf">
    Hello World!!!
    <cfdocumentitem type="pagebreak"/>
    <cfdocumentitem type="header">
    Company Name
    </cfdocumentitem >
    <cfdocumentitem type="footer">
    <div align="center">
    <font color="navy" size="1" face="Tahoma">
    page
    <cfoutput>
    #cfdocument.currentpagenumber#
    </cfoutput>/
    <cfoutput>
    #cfdocument.totalpagecount#
    </cfoutput>
    </font>
    </div>
    </ cfdocumentitem >
    <!-- insert your other HTML text here-->
    </cfdocument>

    You use the cfdocumentsection tag to break HTML into different segments. You can specify unique headers, footers, and other HTML style for each section without affecting other parts of the document (see Code Example 2).

    Code Example 2: Using the cfdocument tag with the cfdocumentsection tag

    <cfdocument format="flashpaper/pdf">
    <cfdocumentsection margintop="1">
    <cfdocumentitem type="header">
    Company Name
    </cfdocumentitem >
    <cfdocumentitem type="footer">
    <div align="center">
    <font color="navy" size="1" face="Tahoma">
    page
    <cfoutput>
    #cfdocument.currentpagenumber#
    </cfoutput>/
    <cfoutput>
    #cfdocument.totalpagecount#
    </cfoutput>
    </font>
    </div>
    </ cfdocumentitem >

    <body style="background-color: #dddddd">
    Hello World!!!
    </body>
    </cfdocumentsection>

    <cfdocumentsection margintop="2">
    <cfdocumentitem type="header">
    Different Header
    </cfdocumentitem >
    <cfdocumentitem type="footer">
    different footer
    </ cfdocumentitem >

    <body style="background-color: #eeeeee">
    Another Section
    </body>
    </cfdocumentsection>
    </cfdocument>

    The user-requirements criteria—ease of use and standards support—were key factors in creating the cfdocument printing functionality. The cfdocument tag gives you a tool that you can use immediately.

    We'll continue to refine this important feature in the future, and we welcome your feedback. We hope you are able to make use of this great new functionality wherever you need to print web content.

    Article Series
    This article is part 5 of a 5 part series. Other articles in this series are shown below:
    1. Printing Web Pages in FlashPaper or PDF Format with ColdFusion MX 7
    2. Your Need for the cfdocument Tag
    3. Easy-to-Use Solution for Developers
    4. Using the cfdocument Tag
    5. Code Examples for the cfdocument Tag

    WiFiReview.com - your guide to the wireless world