PowerPoint Library for C# and VB.NET applications

The fastest way to get started with the GemBox.Presentation library is by exploring our collection of C# and VB.NET examples. These are live examples that demonstrate supported features and APIs for achieving various PowerPoint-related tasks with the GemBox.Presentation component.

System Requirements

GemBox.Presentation works on .NET Framework 3.5 or higher. It doesn't have any other dependency.

Hello World

The first step in using the GemBox.Presentation library is to add a reference to GemBox.Presentation.dll within your C# or VB.NET project. There are three ways how to do that.

a) Add from NuGet.

You can add GemBox.Presentation as a package by using the following command from the NuGet Package Manager Console:

Install-Package GemBox.Presentation

Or you can search and add GemBox.Presentation from the NuGet Package Manager.

Adding GemBox.Presentation library from NuGet

b) Add from Setup.

You can download the GemBox.Presentation Setup from this page. After installing the setup, you can add a reference to GemBox.Presentation.dll from the Global Assembly Cache (GAC).

Adding GemBox.Presentation library from GAC

c) Add from a DLL file.

You can download GemBox.Presentation.dll file from this page and add a reference by browsing to it.

Adding GemBox.Presentation library from DLL

The second step is to add a directive for the GemBox.Presentation namespace.
For a C# project, use using GemBox.Presentation;.
For a VB.NET project, use Import GemBox.Presentation.

The third step is to set the license key to use GemBox.Presentation in one of its working modes.
To use a Free mode in a C# project, use ComponentInfo.SetLicense("FREE-LIMITED-KEY");.
To use a Free mode in a VB.NET project, use ComponentInfo.SetLicense("FREE-LIMITED-KEY").
You can read more about GemBox.Presentation's working modes on the Evaluation and Licensing help page.

The last step is to write your application-specific presentation code, like the following example code that shows how to create a simple presentation with "Hello World!" text. 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 of simple PowerPoint file created with GemBox.Presentation
Simple PowerPoint file created with GemBox.Presentation
using GemBox.Presentation;

class Program
{
    static void Main(string[] args)
    {
        // If using Professional version, put your serial key below.
        ComponentInfo.SetLicense("FREE-LIMITED-KEY");

        var presentation = new PresentationDocument();

        var slide = presentation.Slides.AddNew(SlideLayoutType.Custom);

        var textBox = slide.Content.AddTextBox(ShapeGeometryType.Rectangle, 2, 2, 5, 4, LengthUnit.Centimeter);

        var paragraph = textBox.AddParagraph();

        paragraph.AddRun("Hello World!");

        presentation.Save("Hello World.%OutputFileType%");
    }
}
Imports GemBox.Presentation

Module Program

    Sub Main()

        ' If using Professional version, put your serial key below.
        ComponentInfo.SetLicense("FREE-LIMITED-KEY")

        Dim presentation As New PresentationDocument()

        Dim slide = presentation.Slides.AddNew(SlideLayoutType.Custom)

        Dim textBox = slide.Content.AddTextBox(ShapeGeometryType.Rectangle, 2, 2, 5, 4, LengthUnit.Centimeter)

        Dim paragraph = textBox.AddParagraph()

        paragraph.AddRun("Hello World!")

        presentation.Save("Hello World.%OutputFileType%")
    End Sub
End Module

Check next example or download examples from GitHub.