PowerPoint Library for C# and VB.NET applications

The fastest way how you can get started with GemBox.Presentation library is by exploring our collection of C# and VB.NET examples. These are live examples that demonstrate various supported PowerPoint features in GemBox.Presentation.

System Requirements

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

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.

using GemBox.Presentation;

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

        PresentationDocument presentation = new PresentationDocument();

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

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

        TextParagraph paragraph = textBox.AddParagraph();

        paragraph.AddRun("Hello World!");

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

Module Samples

    Sub Main()

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

        Dim presentation As PresentationDocument = New PresentationDocument

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

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

        Dim paragraph As TextParagraph = textBox.AddParagraph()

        paragraph.AddRun("Hello World!")

        presentation.Save("Hello World.pptx")

    End Sub

End Module

Check next sample.