Installation
Add the NuGet package, see the supported target frameworks, and meet the namespaces.
0Namespaces used by the C# samples
using NetCorePpt; // PptxGen, Slide
using NetCorePpt.CoreInterfaces; // option objects: TextProps* / ShapeProps / ImageProps / TableProps / HAlign / VAlign ...
using NetCorePpt.CoreEnums; // ShapeType, ChartType, MediaType, ShadowType, BulletType, DashType, SCHEME_COLORS ...
using TableRow = System.Collections.Generic.List<NetCorePpt.CoreInterfaces.TableCell>;
NetCorePpt ships as a single NuGet package. Install it with the .NET CLI or add a PackageReference, import the namespaces and start building.
.NET CLI
Sample · bash
dotnet add package NetCorePptPackageReference
Sample · xml
<!-- use the latest version shown on nuget.org -->
<PackageReference Include="NetCorePpt" Version="*" />Namespaces
NetCorePpt · C#
using NetCorePpt; // PptxGen, Slide
using NetCorePpt.CoreInterfaces; // option objects: TextPropsOptions, ShapeProps, ...
using NetCorePpt.CoreEnums; // ShapeType, ChartType, HAlign, VAlign, ...Create your first presentation
Program.cs
NetCorePpt · C#
using NetCorePpt;
using NetCorePpt.CoreInterfaces;
// 1. Create a Presentation
var pptx = new PptxGen();
// 2. Add a Slide to the presentation
var slide = pptx.addSlide();
// 3. Add 1+ objects (text, shapes, tables, charts, ...)
slide.addText("Hello World from NetCorePpt!", new TextPropsOptions
{
x = 1,
y = 1,
color = "363636",
});
// 4. Save the Presentation
await pptx.exportToFile("Hello-World.pptx");Supported target frameworks
The package is compiled for net6.0, net8.0, net10.0, netstandard2.0 and netstandard2.1 — it runs on Windows, Linux and macOS, including server-side generation in ASP.NET Core apps and Azure Functions.