C# Code to convert PowerPoint slide to image

If you want to automate your business process and export PowerPoint files to images then this code can be really helpful. This C# Code will help you to open PowerPoint files programmatically and then export the slide to image.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Microsoft.Office.Core;
using Microsoft.Office.Interop.PowerPoint;

namespace ConsoleApplication1
    class Program
        static void Main(string[] args)
            Application pptApplication = new Application();
            Presentation pptPresentation = pptApplication.Presentations
            .Open("test.pptx", MsoTriState.msoFalse,MsoTriState.msoFalse
            , MsoTriState.msoFalse);

            pptPresentation.Slides[1].Export("slide.png", "png", 320, 240);


In the example we can see that first we are opening a ppt or .pptx file with Application object and then choose the first slide using Slides array. Finally we use Export function to export the slide to PNG format. You can change the output format as JPG but you may lose some quality in the output image.


One comment on “C# Code to convert PowerPoint slide to image

  1. Pingback: Convertir PPT a otros formatos usando Automation Service de PowerPoint 2013 en el servidor | plantillas-powerpoint.com

Comments are closed.