How to convert PowerPoint document to Images

Spire.Presentation is a powerful and easy-to-use .NET component, especially designed for developers. It has many features. Conversion is one important feature that Spire.Presentation provides.

In this document, its conversion to images is introduced. Hoping this document can be helpful to you.

Step 1: Create a presentation document.

Presentation presentation = new Presentation();

Step 2: Load the PPT file from disk.

presentation.LoadFromFile("sample.pptx");

Step 3: Save the slide to Image.

Image image = presentation.Slides[i].SaveAsImage();

Step 4: Save image to file.

String fileName = String.Format("result-img-{0}.png", i);
image.Save(fileName, System.Drawing.Imaging.ImageFormat.Png);

Full code and screenshot:

Presentation presentation = new Presentation();

presentation.LoadFromFile("sample.pptx");

//traverse the slides of PPT files
for (int i = 0; i < presentation.Slides.Count; i++)
{
    //save the slide to Image
    Image image = presentation.Slides[i].SaveAsImage();

    String fileName = String.Format("result-img-{0}.png", i);
    image.Save(fileName, System.Drawing.Imaging.ImageFormat.Png);

    //view the image
    System.Diagnostics.Process.Start(fileName);
}

Convert PPT document to Images

Convert PPT document to Images