5
votes

I would like to develop a class library that could process PowerPoint templates, and populate formatted data. Mainly involving tables, labels, slide cloning. I would like to use Open Xml for this with .Net 4.

I would like some recommendations and references for this. Also would like to know which approach is good, whether to go with OpenXml SDK 2.0 or System.Packaging because I read in some places that using Open Xml SDK consumes bit more memory.

Thanks, Aneef

3
I believe the Open XML SDK 2.5 is required for .NET 4?Coops

3 Answers

4
votes

The Open XML SDK 2.0 is built on top of System.Packaging so it will be easier to write and maintain the code. I found I was able to write two lines of Open XML SDK code whereas when I had wrote it using System.Packaging it was over 200 lines. As far as using more memory, I have not ran into any issues and have found maintainability and readability to out weigh the minimal increase in memory usage.

There aren't many resources out there for using the Open XML SDK with Power Point, but here are two to get you started:

Brian Jones & Zeyad Rajabi blog

MSDN

3
votes

I would first recommend you understand the Presentation Markup Language (PresentationML) before you start using any of the APIs.

There is a free online book that describes PresentationML, WordML, and SpreadsheetML called Open XML Explained. Chapter 3 describes PresentationML and gives you the knowledge required to better use the OpenXML API to do all of the tasks you need to do.

2
votes

A good start for me was using the Document Reflector (Reflect Code tool in the Open XML Productivity Tool of SDK 2.5). Load a .pptx and get the C# code to generate that .pptx - so you learn the structure of PresentationML and get an idea where to put the parameters and options you want - it's not easy, but a good start