Posted in ColdFusion | Posted on 08-29-2007 | 6,737 views
CFPRESENTATION is one of those tags that are pretty good - but I'm not sure how often I'll use it. While working on WACK though I discovered that the tag has a feature that is pretty darn interesting. As you may (or may not know), the CFPRESENTATION tag creates Connect presentations on the fly. This could be useful for multiple purposes. You could use it to create dynamic portfolios for a company. You could use it for tutorials. Etc. This example creates a basic 2 slide static example:
2 autoPlay="false">
3
4 <cfpresentationslide title="Welcome to CFPRESENTATION"
5 notes="These are some notes.">
6<h1>Welcome to CFPRESENTATION</h1>
7
8<p>
9This is content for the first slide. I can include HTML
10and it will be rendered by the presentation.
11</p>
12 </cfpresentationslide>
13
14 <cfpresentationslide title="Sales Figures"
15 notes="These are some notes for slide two.">
16<h1>Sales Figures</h1>
17
18<p>
19Some fake data.
20</p>
21
22<p>
23<table width="100%" border="1">
24<tr>
25 <th>Product</th>
26 <th>Price</th>
27</tr>
28<tr>
29 <td>Apples</td><td>$0.99</td>
30</tr>
31<tr>
32 <td>Bananas</td><td>$1.99</td>
33</tr>
34<tr>
35 <td>Nukes</td><td>$2.99</td>
36</tr>
37</table>
38</p>
39 </cfpresentationslide>
40</cfpresentation>
You can see this output here.
What I discovered (and the reason for the post is), you can also use CFPRESENTATION to create offline presentations as well. If you supply the directory attribute, the generated Connect presentation will be stored to the file system. This code will have no need for ColdFusion and could be zipped up (using CFZIP) and mailed to someone. The end user could then unzip the files onto their desktop and open the presentation there. Here is a short snippet showing this in action:
2<cfif not directoryExists(directory)>
3 <cfdirectory action="create" directory="#directory#">
4</cfif>
5
6<cfpresentation title="First Presentation"
7 autoPlay="false" directory="./stored">
8More slides here...
I've included a simple presentation at the end of this blog post. Just use the download link. For more about CFPRESENTATION, be sure to pick up the WACK!


Answer to q2: You could dynamically generate the preso, but then it is static.
seen Adobe Connect Presenter? the little tool that takes a powerpoint, adds the presenters details and audio track and converts it to a swf as content for your breeze presso?
where have you seen one of them I wonder?
the only thing I've yet to try is saving the PPT to HTML first and then SWF'ing it with the cfpresentation tag.
Cheers,
Davo
Is it possible to print from the presentation. ?
while cfpresentation can use HTML to create content, the final result is a SWF. it's basically CFContent who's output is Flash.
having said that, using a swf as content gives you most of the functionality of Flash. we use it for having a m/c quiz at the end of a presso, so at a guess, a form and posting values to a url might be possible. the target url might have to be hard-coded however...
I can see where you're going with the idea, and it would be great if it could, but I'm not sure it's possible or practical.
oops, I mean cfdocument who's output is flash/flashpaper
Thanks
I just asked this question on CF Talk, and searching Google let me find this post, thank so much!
One question however, is it possible to replace the current files in the stored directory that you write to? That if you should modify the file?
I am just using
<cfpresentation title="my title" directory="./stored">
Thanks so much,
John
Well I got it`-`
<cfpresentation title="my Title" autoPlay="false" directory="./stored" overwrite="yes">
I just wanted to post this here incase somebody else finds this and was wondering the same thing.
Thanks so much:)
John
Without the overwrite=yes, CF threw an error "unable to create file" So I ask asking how to replace the current files this way, but with CF, and not manually replace the files.
By the way, this was for a class presentation, and it was a big hit, the instructor really loved the output, and when I showed him how it was made, even more impressive, CF Rocks:)
Maybe this will motivate the University to get a coldFusion Server.
example: audio="rtmp://x.x.x.x/Music/Track-01.mp3"
I was wondering if you could help on this one. I keep getting the following error message when I try to run a cfpresnetation.
java.io.FileNotFoundException: C:\ColdFusion8\lib\preso\blank.swf (The system cannot find the file specified)
I get this message even if I specifiy a directory. All the files do get created in the directory I specify,
yet i still get this same error message. I've also used your exact code from this post and I get the same thing.
I've googled on this and can't find anything. Thought you might be able to help.
Thanks
Code: <cfpresentationslide src="#assets#intro.swf" />
assets obviously evaluates to: /images/tutorial/
If I put an absolute file path it works.
Has anyone else experienced this?
[Add Comment] [Subscribe to Comments]