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 show supported features and APIs for achieving various PowerPoint-related tasks with the GemBox.Presentation component. GemBox.Presentation requires only .NET, it doesn't have any other dependency. 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: Or you can search and add GemBox.Presentation from the NuGet Package Manager. 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). c) Add from a DLL file. You can download the GemBox.Presentation.dll file from this page and add a reference by browsing to it. The second step is to add a directive for the GemBox.Presentation namespace. For a C# project, use: The third step is to set the license key to use GemBox.Presentation in one of its working modes. To use the Free mode in a C# project, use: 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 PowerPoint 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 System Requirements
You can use it on:Hello World
Install-Package GemBox.Presentation
using GemBox.Presentation;
For a VB.NET project, use: Import GemBox.Presentation
ComponentInfo.SetLicense("FREE-LIMITED-KEY");
To use the Free mode in a VB.NET project, use: ComponentInfo.SetLicense("FREE-LIMITED-KEY")
Slide
, TextBox
, TextParagraph
and TextRun
, and then save the PresentationDocument
to a PowerPoint file.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("Hello World.%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("Hello World.%OutputFileType%")
End Sub
End Module