This topic came up from a cf-newbie discussion this weekend, but did you know that cfpresentation can be used to create HTML presentations? The reference is a bit confusing on the matter. If you look at the docs for the format attribute, it says this:
Specifies the file format for conversion:
- ppt
converts html input provided in cfpresentationslide to a PowerPoint file.- html
converts ppt to an HTML presentation.
The implication being that you can use the tag just to convert a Powerpoint file into HTML. You can do that. But you can also create ad-hoc presentations and feed them right into html. So an example:
<cfpresentation title="Ray's Presentation" format="html" destination="#dest#" overwrite="true">
<cfpresentationslide title="Slide One">
This is my first slide. Epic.
</cfpresentationslide>
<cfpresentationslide title="Slide Two">
This is my second slide. Epic.
</cfpresentationslide>
<cfpresentationslide title="Slide Three">
This is my third slide. Epic.
</cfpresentationslide>
</cfpresentation>
Done.
<cfset dest = expandPath("./mypreso")>
<cfif not directoryExists(dest)>
<cfset directoryCreate(dest)>
</cfif>
In this code template, I'm saving the presentation to a directory. You don't have to do that. If you leave off the destination it will render in the browser. I've added "Done" to the end of the script just so I know, well, when the CFM is done. I've got three simple slides. Once done, the output is saved to a folder:
The result is a HTML/JavaScript slide viewer. I'll be honest. It isn't... stellar. You can view this yourself here: http://www.coldfusionjedi.com/demos/aug82011/mypreso2/
Sexy, right? Ok, maybe not. But for a quick and dirty result, it's better than nothing. Be careful with it. I tried embedding a PNG chart and while it worked locally, it wasn't available when pushed to production.
Archived Comments
I have not tested this but does ColdFusion have a way of buffering these presentations?
Why would it buffer an HTML presentation that doesn't auto forward?
Should have said cached, not buffered. The reason is to reduce overhead of processing same data in Flash format if nothing changes from one user to the next. If the data is personalized then caching would not make sense of course.
Ah, well the destination attribute ALSO works for the vanilla Flex output. So you could generate it once and be done with it. That's what I would do.
Hi,
I just wanna ask if you can use a powerpoint as a source for the cfpresentationslide tag? I want to convert a powerpoint to html. I've been trying to use ppt as a source but it will give me this error: Could not initialize class com.sun.star.lib.loader.WinRegKey
Thanks
I believe you need to have OpenOffice installed on the server for that to work. Do you? And is it configured in the admin?
Hi Raymond,
I too am trying to use a ppt file as the source to create an html presentation, but am stuck with the same error as Jewel Pajarillo. (Could not initialize class com.sun.star.lib.loader.WinRegKey)
The CF9 docs say OO is only required for using doc files as the source? Any idea what else the issue could be? Unfortunately the error doesn't give any other details.
Thanks,
Shane
Um - no idea. Did you try adding OO even though it may says you don't need to?