Import PowerPoint from PDF or HTML
Contents
[
Hide
]
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.
- Create an instance of the Presentation class.
- Call the AddFromPdf method and pass the PDF file.
- 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);
}
TIP
You may want to check out Aspose free PDF to PowerPoint web app because it is a live implementation of the process described here.Import PowerPoint from HTML
In this case, you get to convert a HTML document to a PowerPoint presentation.
- Create an instance of the Presentation class.
- Call the AddFromHtml method and pass the HTML file.
- 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);
}
Note
You may also use Aspose.Slides to convert HTML to other popular file formats: