Import Presentation - C++ PowerPoint API

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

Import PowerPoint from PDF

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

pdf-to-powerpoint

  1. Instantiate an object 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:

auto pres = System::MakeObject<Presentation>();
    
pres->get_Slides()->AddFromPdf(u"InputPDF.pdf");
pres->Save(u"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 in the PowerPoint format.

This C++ code demonstrates the HTML to PowerPoint operation:

auto presentation = System::MakeObject<Presentation>();

{
    auto htmlStream = System::IO::File::OpenRead(u"page.html");
    presentation->get_Slides()->AddFromHtml(htmlStream);
}

presentation->Save(u"MyPresentation.pptx", SaveFormat::Pptx);