Categories

Partners
  • 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

    Using the cfdocument Tag
    Published  06/28/2006 | Macromedia FlashPaper
       




    Using the cfdocument Tag

    This is the most exciting part of introducing this feature—showing you how to use it!

    Sample 1: Using the cfdocument with cfhttp tag

    This is what makes the cfdocument tag powerful. There is no need to edit your current HTML. You just redirect the content of the HTTP request through the cfdocument tag (see Figure 1):

    <cfhttp url="http://www.w3.org/TR/REC-html32" method="get" resolveURL="true">
    <cfdocument format="flashpaper">
    <cfoutput>#cfhttp.filecontent#</cfoutput>
    </cfdocument>
    Code in Sample 1 printing the HTML content as you see it on the web page

    Figure 1. Code in Sample 1 printing the HTML content as you see it on the web page

    Sample 2: Using the cfdocument tag with existing third-party report output

    If you use a third-party reporting engine and plan to output the results in HTML, you can use the cfdocument tag to help create a portable document exactly as it appears. This saves much time and effort on your part because you don't need to recreate reports just for the purpose of printing to rich document formats. You simply wrap your query/report result with the tag and it gives you the desired printing result (see Figure 2).

    Creating portable documents from third-party reporting engines

    Figure 2. Creating portable documents from third-party reporting engines

    Sample 3: Creating portable documents for easier sharing

    Besides printing in a visually appealing format, you can use the cfdocument tag to create documents that are portable and that you can combine with the cfmail tag to send output to other users:

    <cfhttp url="http://www.w3.org/TR/REC-html32" method="get" resolveURL="true">
    <cfdocument format="flashpaper" filename="c:\temp\w3spec.swf">
    <cfoutput>#cfhttp.filecontent#</cfoutput>
    </cfdocument>
    <cfmail to = "recipient"
    from = "sender"
    subject = "msg_subject"
    MIMEAttach = "c:\temp\w3spec.swf">
    Hi John, here is the spec you were looking for. Regards, </cfmail>

    Sample 4: Bidirectional text support

    If you write text from right to left, you can now use the cfdocument tag to print (only available in PDF).

    Bidirectional language support in PDF format

    Figure 3. Bidirectional language support in PDF format

    Article Series
    This article is part 4 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