Syncfusion Feedback

Convert PowerPoint to PDF with Syncfusion .NET PowerPoint Library

The Syncfusion® .NET PowerPoint Library offers powerful APIs for programmatically converting PowerPoint files to PDF with minimal code in C#, without Microsoft PowerPoint or interop dependencies.

Watch this video to learn how to convert PowerPoint presentations to PDF using the Syncfusion® .NET PowerPoint library.

Watch the video

Convert PowerPoint to PDF using C#

Learn how to convert PowerPoint presentations to PDF documents programmatically using C# with the Syncfusion .NET PowerPoint library. This guide demonstrates converting presentations to PDF formats for archiving and sharing purposes effectively.

Step 1: Create a new project

Start by creating a new C# Console Application project.

Step 2: Install the NuGet package

Add the Syncfusion.PresentationRenderer.Net.Core package to your project from NuGet.org.

Step 3: Add required namespaces to convert PowerPoint to PDF

Add the following namespaces to your Program.cs file:

using Syncfusion.Pdf;
using Syncfusion.Presentation;
using Syncfusion.PresentationRenderer;

Step 4: Open an existing PowerPoint presentation

Open a PowerPoint file from a file stream.

FileStream fileStream = new FileStream(Path.GetFullPath(@"Data/Template.pptx"), FileMode.Open, FileAccess.Read, FileShare.ReadWrite)
//Load an existing PowerPoint Presentation
IPresentation pptxDoc = Presentation.Open(fileStream)

Step 5: Convert PowerPoint to PDF

Convert the PowerPoint presentation to a PDF document.

Run

//Convert PowerPoint into PDF document
PdfDocument pdfDocument = PresentationToPdfConverter.Convert(pptxDoc)

Step 6: Save the PDF document

Save the converted PDF to a file stream.

//Save the PDF file to file system
FileStream outputStream = new FileStream(Path.GetFullPath(@"Output/PPTXToPDF.pdf"), FileMode.Create, FileAccess.ReadWrite, FileShare.ReadWrite)
pdfDocument.Save(outputStream);
//Close resources
outputStream.Close();
pdfDocument.Close();
pptxDoc.Close();
fileStream.Close();

Get started quickly by downloading the installer and checking license information on the Downloads page.

Syncfusion .NET PowerPoint Library Resources

Explore these resources for comprehensive guides, knowledge base articles, insightful blogs, and ebooks.