Getting started with GemBox.Presentation

GemBox.Presentation is a .NET component that enables you to read, write, convert, and print presentation files (PPTX, PPT, and PPSX) from .NET applications.

Requirements

GemBox.Presentation requires only .NET. It supports a wide range of .NET versions, as listed below:

  • .NET 6.0+ (Windows only)
  • .NET Standard 2.0+ (Android, iOS, Linux, macOS, Windows)
  • .NET Framework 3.5+ (Windows only)

Installation

Before you can use GemBox.Presentation, you need to install it in your project. The best way is by adding a GemBox.Presentation NuGet package via NuGet Package Manager in Visual Studio.

To install the package, you can follow the steps listed below. However, please note that this guide assumes you have already set up a Visual Studio project. If you haven't done that yet, you can refer to the official tutorial for guidance.

  1. Right-click on the project's solution in the Solution Explorer and select 'Manage NuGet Packages for Solution'.
    Manage NuGet Packages
  2. On the newly opened view, click the 'Browse' tab and search for GemBox.Presentation. Once found, click on 'Install'.
    Install GemBox.Presentation NuGet package
  3. That is it. Once the installation finishes, you will be able to use the component in your code.

As an alternative, you can open the NuGet Package Manager Console (Tools -> NuGet Package Manager -> Package Manager Console) and run the following command:

Install-Package GemBox.Presentation

We also provide DLL and setup files on GemBox.Presentation's Downloads page. A link for the latest setup file is located at the bottom of the page, under the 'Global Assembly' section.

Usage

Once you have installed GemBox.Presentation, all you have to do is add the using directive and make sure you call the ComponentInfo.SetLicense method before using any member of the component. We suggest putting the call at the beginning of the Main() method.

The ComponentInfo.SetLicense requires a license key as a parameter. If you are using the component in a Free mode, use "FREE-LIMITED-KEY" as a license key, and if you have purchased a Professional license, use the key you got in your email after the purchase. You can read more about GemBox.Presentation's working modes on the Evaluation and Licensing page.

After that, you can write your application code for working with presentations, like the code below. It shows how to create a simple PowerPoint presentation using GemBox.Presentation's content model, populate it using common presentation elements like Slide, TextBox, TextParagraph and TextRun, and then save the PresentationDocument to a PPTX file.

You can click the 'Run Example' button to run the code and download the resulting file. You can also change the output format by selecting a corresponding file type from the 'Output file type' dropdown control.

using GemBox.Presentation;

class Program
{
    static void Main()
    {
        // If using the 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("HelloWorld.%OutputFileType%");
    }
}
Imports GemBox.Presentation

Module Program

    Sub Main()

        ' If using the 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("HelloWorld.%OutputFileType%")

    End Sub

End Module
Screenshot of a PowerPoint file created with GemBox.Presentation
Screenshot of a PowerPoint file created with GemBox.Presentation

To learn more about GemBox.Presentation, check out our collection of examples listed on the menu. These examples will show you how to use the component in various presentation-processing tasks and platforms. Additionally, for detailed information on the API, head to our documentation pages. This resource offers a comprehensive API reference, explaining each method and property available within the component.

See also


Next steps

GemBox.Presentation is a .NET component that enables you to read, write, edit, convert, and print presentation files from your .NET applications using one simple API.

Download Buy