This article contains the steps and code samples to convert PDF to PPT or PPTX programmatically in C#.
PDF is one of the widely used formats for exchanging documents with reliability without worrying about layout issues. The PowerPoint presentations (PPT/PPTX), on the other hand, have made it easier to present the data or information in the form of interactive slides. In some cases, the information contained in a PDF file is needed to be presented as a PowerPoint presentation. For such a case, you can minimize the efforts by automating the process of importing information from PDF to PowerPoint PPT/PPTX.
In order to deal with the above-mentioned scenario, this article will demonstrate how to:
- Convert PDF to PowerPoint PPT or PPTX in C#.
- Convert PDF to PowerPoint PPT or PPTX with slides as images in C#.
- Track PDF to PowerPoint conversion progress.
C# API for PDF to PowerPoint Conversion
In order to convert PDF to PPT or PPTX, we’ll use Aspose.PDF for .NET which is a powerful PDF API to create, process and convert PDF documents. Aspose.PDF for .NET is available on NuGet as well as in the form of DLL in the Downloads section.
Convert PDF to PPT or PPTX in C#
The following are the steps to convert a PDF file to a PowerPoint presentation using Aspose.PDF for .NET.
- Create an object of the Document class.
- Create an object of the PptxSaveOptions class.
- Call the Document.Save() method to save the PDF as PPT or PPTX.
The following code sample shows how to convert PDF to PPT in C#.
Converted PowerPoint PPT
Convert PDF to PPT in C# – Rendering Slides as Images
In case you want to avoid having selectable text in the converted PowerPoint presentation, you can render each slide as an image. For this, you can set PptxSaveOptions.SlidesAsImages property to true and the rest of the steps will remain the same.
The following code sample shows how to convert PDF to PPT having slides as images in C#.
Track PDF to PPT Conversion Progress
You may also track the progress of the PDF to PPT conversion process using Aspose.PDF for .NET. The following information can be retrieved about the conversion process:
- Total progress of the conversion
- End of analysis of each page before conversion
- Creation of result page before physical export
- Export of each result page
The following code sample shows how to track the PDF to PPT conversion in C#.