How to convert PowerPoint document to EMF image in C#

Spire.Presentation has powerful functions to export PowerPoint documents into different image file formats. In the previous articles, we have already shown you how to convert PowerPoint documents into TIFF, PNG and JPG. This article will demonstrate how to convert PowerPoint documents into EMF image. With Spire.Presentation for .NET, we can save presentation slides as an EMF image with the same size with the original slide's size and we can also set a specific size for the resulted EMF image.

Convert Presentation slides to EMF with the default size:

Step 1: Create a presentation document.

Presentation presentation = new Presentation();

Step 2: Load the PPTX file from disk.

presentation.LoadFromFile("Sample.pptx", FileFormat.Pptx2010);

Step 3: Save the presentation slide to EMF image by the method of SaveAsEMF().

presentation.Slides[2].SaveAsEMF("Result.emf");

Effective screenshot:

How to convert PowerPoint document to EMF image in C#

Convert Presentation slides to EMF with a specific size of 1075*710:

Step 1: Create a presentation document.

Presentation presentation = new Presentation();

Step 2: Load the PPTX file from disk.

presentation.LoadFromFile("sample.pptx");

Step 3: Save the presentation slide to EMF image with a specific size of 1075*710 by the method of SaveAsEMF(string filePath, int width, int height).

presentation.Slides[2].SaveAsEMF("Result2.emf", 1075, 710);

Effective screenshot:

How to convert PowerPoint document to EMF image in C#

Full codes:

using Spire.Presentation;
namespace PPStoEMF
{
    class Program
    {
        static void Main(string[] args)
        {
            Presentation presentation = new Presentation();
            presentation.LoadFromFile("Sample.pptx", FileFormat.Pptx2010);

            //presentation.Slides[2].SaveAsEMF("Result.emf");
            presentation.Slides[2].SaveAsEMF("Result2.emf", 1075, 710);
        }
    }
}