This topic focuses on how to convert PPT to PDF using C# along with the detailed configuration steps to configure the environment and verify the working sample code. To convert PowerPoint to PDF C# Interop based complex API solution is one of the options, however in this example we will manage the conversion using a few simple lines of code without Interop library.
Steps to Convert PPT to PDF using C#
- Configure the application to install Aspose.Slides for .NET using the NuGet package manager
- Load the source presentation file using the Presentation class object to set the desired PDF options
- Initialize the PdfOptions class object to set the desired image options
- Set the different PDF options for PDF
- Convert the presentation to PDF using the Save method
By adhering to aforementioned steps in C# PowerPoint to PDF converter application is developed where by the process begins by loading the source PPT from the disk using the Presentation class instance. Then, by using PdfOptions class different properties of the desired PDF are set and finally the generated PDF is saved either on the disk or in memory stream for further usage.
Code to Convert PPT to PDF in C#
In the above example the conversion of PPT to PDF in C# is demonstrated using simple API calls. The API allows to load the PPTX, POTX, ODP, PPS, PPSX and other presentation formats using the same example and their conversion to PDF. The PdfOptions class allows you to customize the output PDF by setting properties like compliance, EmbedFullFonts, DrawSlidesFrame, ImageTransparentColor, JpegQuality, ShowHiddenSlides and NotesCommentsLayouting.
In this tutorial, we learnt that in order to convert PPT to PDF C# based API can be used by performing the simple steps. If you are interested in converting the presentation to TIFF images, refer to the article on how to convert PowerPoint to Tiff using C#.