PowerPoint Library for C# and VB.NET applications

GemBox.Presentation is a C# / VB.NET library that provides a simple and efficient way to process PowerPoint files. It enables developers to read, write, convert, and print presentation files (PPTX, PPT, PDF, XPS, and image formats) from .NET applications without a need for Microsoft PowerPoint on either the developer or client machines.

GemBox.Presentation requires .NET Framework version 3.5 or above.

GemBox.Presentation Examples are listed on the right side of the page. Use the list to explore the supported features.

Below the example description there are Run options used to specify the output file format and execute the example using GemBox.Presentation in Professional mode (without any limitation). For more information about GemBox.Presentation modes (Free, Trial, Time Limited, and Professional), see Evaluation and Licensing help page.

Hello World

The following example creates a simple PowerPoint file, with "Hello World!" text, in C# and VB.NET code. It shows how to initialize the GemBox.Presentation content model, populate the common presentation elements Slide, TextBox, TextParagraph and TextRun, and then save the PresentationDocument to a PowerPoint file.

Screenshot

PowerPoint Library for C# / VB.NET Screenshot

See the full code below, use RUN EXAMPLE to execute.


1using GemBox.Presentation;
2
3class Sample
4{
5    [STAThread]
6    static void Main(string[] args)
7    {
8        // If using Professional version, put your serial key below.
9        ComponentInfo.SetLicense("FREE-LIMITED-KEY");
10
11        PresentationDocument presentation = new PresentationDocument();
12
13        Slide slide = presentation.Slides.AddNew(SlideLayoutType.Custom);
14
15        TextBox textBox = slide.Content.AddTextBox(ShapeGeometryType.Rectangle, 2, 2, 5, 4, LengthUnit.Centimeter);
16
17        TextParagraph paragraph = textBox.AddParagraph();
18
19        paragraph.AddRun("Hello World!");
20
21        presentation.Save("Hello World.pptx");
22    }
23}
1Imports GemBox.Presentation
2
3Module Samples
4
5    Sub Main()
6
7        ' If using Professional version, put your serial key below.
8        ComponentInfo.SetLicense("FREE-LIMITED-KEY")
9
10        Dim presentation As PresentationDocument = New PresentationDocument
11
12        Dim slide As Slide = presentation.Slides.AddNew(SlideLayoutType.Custom)
13
14        Dim textBox As TextBox = slide.Content.AddTextBox(ShapeGeometryType.Rectangle, 2, 2, 5, 4, LengthUnit.Centimeter)
15
16        Dim paragraph As TextParagraph = textBox.AddParagraph()
17
18        paragraph.AddRun("Hello World!")
19
20        presentation.Save("Hello World.pptx")
21
22    End Sub
23
24End Module

Check next sample or find out more about GemBox.Presentation and GemBox Software.