Direct writing Powerpoint files on iOS and OSX
LibPptx is a software framework/library that writes PowerPoint presentations programatically in OpenXML/PresentationML format. It doesn't require Microsoft PowerPoint or any other 3rd party runtime, combines an easy to use and powerful features. Library can be used to
- generate a new pptx presentation from scratch
- extract data from an existing pptx presentation
- edit an existing presentation
LibPptx can help your applications in exporting and extracting data to/from PowerPoint files with minimum effort.
Also it can be used as a report engine. Library can be used mainly in ObjectiveC and Swift on iOS and OSX systems. Supports PowerPoint 2007-2016 xml formats (pptx). Supports Unicode and 64-bit platforms.
Simple interoperate, no Office dependency
LibPptx has ObjectiveC interface and bridge to Swift.
It could be also used from C and C++ code through GCC ObjC.
Rich OpenXML/PresentationML support
LibPpptx has the following capabilities, with many more on the roadmap:
- Round-trip any Open XML (PresentationML) presentation (.pptx file) including all its elements
- Add slides
- Populate text placeholders, for example to create a bullet slide
- Add image to slide at arbitrary position and size
- Add textbox to a slide; manipulate text font size and bold
- Add table to a slide
- Add auto shapes (e.g. polygons, flowchart shapes, etc.) to a slide
- Add charts (bar, line, pie, scatter, ...)
- Add slide notes
- Generating slide previews in png format
- Access and change core document properties such as title and subject
Royalty-free distribution with your application
Our customers can use this library/framework in their commercial applications without any additional fees.
LibPptx code examples
A quick way to get started with LibPptx is by trying out some of the examples below to get a feel for how to use LibPptx
Hello World example
#import "libpptx.framework/Headers/PptxManager.h"
@implementation SomeClass
-(void) generatePptx
{
// point PptxManager to default.pptx (a template presentation)
NSString *templateUrlAddress = [[NSBundle mainBundle] pathForResource:@"default" ofType:@"pptx"];
// for trial mode keep license and email empty
PptxManager* manager = [[PptxManager alloc] initWithLicense:@"" andEmail:@"" andTemplate:templateUrlAddress];
// retrieve pointer to Presentation from PptxManager to manipulate presentation
Presentation* presentation = [manager presentation];
// add slide based on layout
Slide* slide1 = [presentation addSlideWithLayoutId:2];
Title* title = [[slide1 createShapeOfType:[Title class]] withText:@"Hello world!"];
[[[[title getContent] withBold:YES] withItalic:YES] withSizePt:72];
[slide1 addShape: title];
[slide1 addShape: [[slide1 createShapeOfType:[SubTitle class]] withText:@"LibPptx generated this"]];
NSString* savedLocation = [manager saveWithFileName:@"my.pptx"];
NSLog(@"Your presentation has been saved to: %@", savedLocation);
}
@end
More code examples are available in
documentation