We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Converting presentation to pdf

I am trying to convert a pptx into a pdf and thought I have followed the example found at https://help.syncfusion.com/file-formats/presentation/presentation-to-pdf

packagereference include="Syncfusion.PresentationToPDFConverter.WinForms" version="">
packagereference include="Syncfusion.OfficeChartToImageConverter.WinForms" version="">packagereference include="Syncfusion.Presentation.WinForms" version="">

private static async Task Main(string[] args) {
var powerpointDoc = Presentation.Open("d:\\_tmp\\Output.pptx");
powerpointDoc.ChartToImageConverter = new ChartToImageConverter();
PdfDocument pdfDocument = PresentationToPdfConverter.Convert(powerpointDoc);

I also had to install

But I am running into the following error. I cant see to fathom this one out, can anyone help?


1 Reply

AA Akash Arul Syncfusion Team November 17, 2022 01:31 PM

From the given details, we have found that you have installed the Syncfusion.PresentationToPdfConverter.WinForms NuGet package in your Console Application targeting .NET 6.0.

To resolve the reported issue, we recommend you to uninstall all the Syncfusion NuGet packages from your application and install the Syncfusion.PresentationRenderer.Net.Core NuGet package in your Console Application targeting .NET 6.0 to perform Presentation to PDF conversion.


NuGet Package

UWP, ASP.NET Core, Console Application (Targeting .NET Core) and Blazor


Windows Forms, Console Application (Targeting .NET Framework)


Please refer our UG documentation link to know what are the NuGet packages that need to be installed in application based on the platform to perform Presentation to PDF conversion,

Note: For .NET Framework, creating an instance of the ChartToImageConverter class is mandatory to convert the charts present in the Presentation document to PDF. Otherwise, the charts are not preserved in the converted PDF. Whereas this is not necessary for .NET Core, as ChartToImageConverter is initialized internally in Syncfusion.PresentationRenderer assembly.

Please refer the below code snippet to convert Presentation document to PDF in .NET Core application.

//Load the PowerPoint presentation into stream.

using (FileStream fileStreamInput = new FileStream(@"Template.pptx", FileMode.Open, FileAccess.Read))


//Open the existing PowerPoint presentation with loaded stream.

using (IPresentation pptxDoc = Presentation.Open(fileStreamInput))


//Create the MemoryStream to save the converted PDF.

using (MemoryStream pdfStream = new MemoryStream())


//Convert the PowerPoint document to PDF document.

using (PdfDocument pdfDocument = PresentationToPdfConverter.Convert(pptxDoc))


//Save the converted PDF document to MemoryStream.


pdfStream.Position = 0;


//Create the output PDF file stream

using (FileStream fileStreamOutput = File.Create("Output.pdf"))


//Copy the converted PDF stream into created output PDF stream






Please refer our documentation links to know more about Presentation to PDF conversion,

If the reported issue is still not resolved, please share us the following details to check issue from our side,

1.List of Syncfusion NuGet packages\assemblies used and its version,
2.TargetFrameWork and Platform of your application.

Live Chat Icon For mobile
Up arrow icon