Build Slide Export

I blogged yesterday about the issues I’m having with manually repurposing content. One of the specific issues has to do with the Architecture Strategy Series. We provide that content via three channels – DVD, online seminars and (soon) download. We use Producer to create the DVD and download files. However, online seminar system doesn’t support Producer. The primary issue is that Producer uses the Save as HTML version of the PPT, but the online seminar system only supports static images. This means having to manually strip out the animations, which is a pain in the ass. Since I don’t ever want to have to do that again, I wrote a PowerPoint add-in to do it for me.

When you invoke the Build Slide Export add-in , it will step thru your presentation and screen capture each slide build to disk. It’s very similar to the built in Save as JPEG/GIF/PNG feature, except that it creates an image per build, not per slide. So those complex build slides turn out multiple image files. It’s sort that you can’t use the machine for anything else while it’s processing, but it was really easy to write the code. I tested it on a long complex PPT file with lots of builds (i.e. the one that took me hours to repurpose on Monday) and it took about 10 minutes.

I’m also providing the source to the add-in. It’s not much code: maybe 150 lines of relevant code at most. I grabbed the screen capture code from Perry Lee on C# Corner.

There were a couple of gotchas involved with this add-in. For example, the add-in project type uses version 7.0 of the office.dll that comes with VS.NET. However, Office 2003 comes with version 11.0 of that DLL and not 7.0, so the first time I went to deploy on my production machine, it didn’t work. I had to grab the right version of office.dll out of the GAC in order to reference it, so it’s included in the lib directory of the source archive (it looks like Simon did something similar with Niobe). Also, PowerPoint’s object model is a little funky. Specifically, SlideShowView.Next() has to be called differently depending on the types of builds in the slides. I handle four different scenarios in the code: no builds, only auto trigger builds, and manual trigger builds, optionally with a set of auto trigger builds before the first manual trigger build.

I’m sure there’s other enhancements that could be made – for example, the directory the images are saved isn’t selectable nor is the image format. If there’s any interest, I’ll spin up a GDN workspace.

Update: I just noticed a bug, albiet a cut-and-paste bug on my part. Turns out the screen capture code that I used is creating four image objects for each screen capture. To make matters worse, three of them are never assigned to a variable, so you can’t call Dispose() on them. So for any real-sized presenation, memory usage goes thru the roof. It’s relatively easy to fix. Take the code that looks like this:

Bitmap image = new Bitmap(
    Image.FromHbitmap(new IntPtr(hBitmap)),
    Image.FromHbitmap(new IntPtr(hBitmap)).Width,
    Image.FromHbitmap(new IntPtr(hBitmap)).Height);
image.Save(fileName,imageFormat);

And replace it with this:

Bitmap image = Image.FromHbitmap(new IntPtr(hBitmap));
image.Save(fileName,imageFormat);
image.Dispose();

With the improved code, only one bitmap per screen capture is made, and it’s explicitly disposed. That keeps memory usage under control.

Another Update: I’ve updated the binary and the code links above with the new v1.0.1 version that fixes the memory hogging problem.

Looking for SPSynd Volunteers

I had eight people waiting to be admitted to the SharePoint Syndication GDN Workspace. Sorry for the delay folks – my workspace was maxed out on users and I had to get upgraded by GDN. Anyway, I’ve been given more membership slots, so the people who’ve been waiting – some since January – are now in.

There has been a lot of interest in this project and others like it. Jonathan Malek has his SpsRssGen project. Sig Weber has an RSS Generator for SPS. All in all, there is quite a bit of interest in this developing for SharePoint in general and creating syndication feeds in particular. Too bad I can’t get more involved. With my new job, I just don’t have the time to work on this project anymore. 😦

Since I can’t keep the project up, I’m wondering if someone else would like to take up the reins. I posted all the code to the workspace, but so far there’s been little traffic other than people wanting to join. I was hoping for more participation, but then I haven’t done anything to foster that so I really can’t complain. So let me ask explicitly: If you’re interested in being an admin on this project, please send me email. Once I get an admin (or two) and a core group of interested developers, I’ll start hosting chats / email lists / live meetings / conference calls / smoke signals / whatever to discuss the project direction. Personally, my #1 feature is an admin interface for creating the syndication feeds integrated directly into the existing SharePoint admin interface. Not sure how doable that is, but let’s find out. After that, I’m open to suggestions as to project direction.

Learning in the Hell of Content Repurposing

I spent yesterday in content repurposing hell. As part of my community role, I’m pushing for making as much content available in as many different channels as possible. However, right now, repurposing content for the different channels is handled with an expensive and time consuming manual process. Want a new publishing channel, we need a new manual processes to repurpose the content for it.

Of course, one of the reasons for this is that the data formats used by these programs are proprietary. Even in places where there is a standard, the files don’t all follow it exactly. For example, I’m having issues converting a bunch of EPS files to JPG. According to Ghostscript, the files have several structuring errors which is making it difficult to open in other programs. Plus, much of this content was authored on a Mac, so trying to bring things like fonts over to PC is a major pain. It doesn’t look like any of the XML or web services standardization work has crossed over into content production or graphic design.

However, there is a more fundamental reason that all these processes are manual – they weren’t designed any other way! Automatic process doesn’t happen by accident, it needs to be explicitly designed. So while having open data formats would make it easier to go in after the fact, it’s no substitute for designing the process from the start.

Going forward, I’m going to explicitly design a multi-channel publishing process for my different content types. The analogy to enterprise software is obvious – explicitly design your process for automation and extensibility. It won’t happen any other way.

Misery Loves Company

Fellow ‘softie and Washington Caps fan Dan Fernandez feels my pain. I called my father the other day and chirped: “Any new ex-Caps today?” and was very depressed to hear “Yeah, Gonchar’s gone”. I know I SAID my favorite Caps were on one way tickets out of town, but it’s depressing to be right. Between the fire sale and the upcoming CBA quagmire, I wonder if the Caps will sell ANY season tickets for next year.

I have a coworker who used to work for AOL in general and Ted “Hockey Abomination” Leonsis in particular. He’s watched a game from the owner box. I told him to give Ted a message for me : “Sell the Team”. Of course, I’m guessing he’s hearing that message on several fronts these days.

Update: Raymond Chen enjoyed a Seattle Thunderbirds game recently. Also, the annual Microsoft Hockey Challenge is next weekend. Traditionally, we played rival IT companies like Sun and AOL, thrashing them soundly on the ice (the one time I went, we been Sun 8-1). This year, there are a variety of intra-MSFT games and a series of MSFT vs. Customer games, but no industry rivalry games. Bummer!

URL Addressability

In a meeting with Ward the other day, he brought up the importance of URL addressability in the context of a project we are working on. I’ve run into this issue twice recently.

  • We just posted the streaming content for The Architecture Strategy Series on the MSDN Architecture Center. While I can link directly to the sessions, there’s a script on that page that pops the session up in it’s own window and checks what version of Media Player you have installed. If I link directly, the window resizes wrong and you don’t get video with the audio. So I end up linking to the series page instead.
  • TechEd just posted their list of breakouts, including the session I’m delivering. However, I can only link to the overall breakout page, not to my specific session. If you want to see my session, you can filter by speaker.

Suffice to say, I’ll be considering URL addressability from now on in anything I have a hand in developing in the future.