Import PowerPoint from PDF or HTML

Using Aspose.Slides for .NET, you can import presentations from files in other formats. Aspose.Slides provides the SlideCollection class to allow you to import presentations from PDF documents.

Import PowerPoint from PDF

In this case, you get to convert a PDF to a PowerPoint presentation.

pdf-to-powerpoint

  1. Create an instance of the Presentation class.
  2. Call the AddFromPdf method and pass the PDF file.
  3. Use the Save method to save the file in the PowerPoint format.

This C# code demonstrates the PDF to PowerPoint operation:

using (Presentation pres = new Presentation())
{
    pres.Slides.AddFromPdf("InputPDF.pdf");
    pres.Save("OutputPresentation.pptx", SaveFormat.Pptx);
}

Import PowerPoint from HTML

In this case, you get to convert a HTML document to a PowerPoint presentation.

  1. Create an instance of the Presentation class.
  2. Call the AddFromHtml method and pass the HTML file.
  3. Use the Save method to save the file as a PowerPoint document.

This C# code demonstrates the HTML to PowerPoint operation:

using (var presentation = new Presentation())
{
    using (var htmlStream = File.OpenRead("page.html"))
    {
        presentation.Slides.AddFromHtml(htmlStream);
    }

    presentation.Save("MyPresentation.pptx", SaveFormat.Pptx);
}