PDF to Editable PowerPoint — C#
Introduction
In this article, I am going to explain how we can convert PDF to Editable PowerPoint which can be easy under stand & compatible.
NuGet Package
The package to convert PDF into Editable PowerPoint is Aspose.PDF for .NET
Aspose for .NET is a modern and professional PDF API used to create, read-write, modify, and make other operations with PDF files without any external dependencies in a .NET application. You can use Aspose for .NET in any programming language for .NET or .NET Core.
Installation
Open NuGet Package Manager and then Package Manager Console and type below command:
Install-Package Aspose.PDF
or using Manage NuGet Packages.
Conversion
Once the package is installed, follow below steps:
- Place your PDF in some location in Project say /TempPdf/Demo.pdf
- Specify location to save PPTX file say /TempPptx/
3. Load the PDF on the Aspose.PDF document.
4. Specify SaveOptions for PPTX
string directory = System.Web.HttpContext.Current.Server.MapPath(“~/TempPdf”);
Aspose.Pdf.Document doc = new Aspose.Pdf.Document(directory + “\\demo.pdf”);
Aspose.Pdf.PptxSaveOptions pptx_save = new Aspose.Pdf.PptxSaveOptions();
doc.Save(directory + “//result.pptx”, pptx_save);
The above code will convert the PDF to PPTX which is editable and saved to supplied location
You can also give some more SaveOptions as:
If you want to convert each image separately, use below option
pptx_save.SeparateImages = true;
If you want to see the progress on Console or File, use below option
pptx_save.CustomProgressHandler = ShowProgressOnConsole;
Create ShowProgressOnConsole() method as:
If you want to see Slide As Images, use below option
pptx_save.SlidesAsImages = true;
Now all set, run the application, you will be able to see the PPTX in the location provided. Open the PPTX file and you will see it will be editable
This is kind of plug and play package with minimal coding
Happy Coding !!