Load, render, view, convert PPTX document using C#

Blog category: Office.NET

August 03, 2026

A PPTX file is a Microsoft PowerPoint Open XML document that contains a presentation.

In this article, we'll cover the most common situations that arise when loading, rendering, viewing, and converting PPTX documents. All code examples below use VintaSoft Imaging .NET SDK and VintaSoft Office .NET Plug-in.

To work with PPTX documents VintaSoft Imaging .NET SDK uses its own Open XML Office engine, which is written from scratch in C# and is independent of Microsoft Office.


Getting information about a PPTX document

A PPTX document, like any "Open XML" document, contains information about the document in the OpenXmlDocumentInformation object.

Here is C# code that demonstrates how to get information about a PPTX document:
/// <summary>
/// Shows information about PPTX document from metadata tree.
/// </summary>
/// <param name="pptxFilename">A name of PPTX file.</param>
public static void ShowPptxDocumentInfoFromMetadataTree(string pptxFilename)
{
    // create image collection
    using (Vintasoft.Imaging.ImageCollection images = new Vintasoft.Imaging.ImageCollection())
    {
        // add PPTX document to the image collection
        images.Add(pptxFilename);
        // if image collection has images/pages
        if (images.Count > 0)
        {
            // get the first image/page
            Vintasoft.Imaging.VintasoftImage firstImage = images[0];

            // get PptxDocumentMetadata object from the metadata tree of PPTX decoder
            Vintasoft.Imaging.Metadata.PptxDocumentMetadata pptxDocumentMetadata =
                firstImage.SourceInfo.Decoder.GetDocumentMetadata() as Vintasoft.Imaging.Metadata.PptxDocumentMetadata;
            // if PptxDocumentMetadata object is found
            if (pptxDocumentMetadata != null)
            {
                // get PPTX document from PptxDocumentMetadata object
                Vintasoft.Imaging.Office.OpenXml.Pptx.PptxDocument pptxDocument =
                    pptxDocumentMetadata.Document;

                // show information about PPTX document

                System.Console.WriteLine(string.Format("PPTX document \"{0}\" information:", pptxFilename));
                System.Console.WriteLine(string.Format(" - Page count: {0}", pptxDocument.Pages.Count));
                System.Console.WriteLine(string.Format(" - Category: {0}", pptxDocument.DocumentInformation.Category));
                System.Console.WriteLine(string.Format(" - ContentStatus: {0}", pptxDocument.DocumentInformation.ContentStatus));
                System.Console.WriteLine(string.Format(" - ContentType: {0}", pptxDocument.DocumentInformation.ContentType));
                System.Console.WriteLine(string.Format(" - Created: {0}", pptxDocument.DocumentInformation.Created));
                System.Console.WriteLine(string.Format(" - Creator: {0}", pptxDocument.DocumentInformation.Creator));
                System.Console.WriteLine(string.Format(" - Description: {0}", pptxDocument.DocumentInformation.Description));
                System.Console.WriteLine(string.Format(" - Identifier: {0}", pptxDocument.DocumentInformation.Identifier));
                System.Console.WriteLine(string.Format(" - Keywords: {0}", pptxDocument.DocumentInformation.Keywords));
                System.Console.WriteLine(string.Format(" - Language: {0}", pptxDocument.DocumentInformation.Language));
                System.Console.WriteLine(string.Format(" - LastModifiedBy: {0}", pptxDocument.DocumentInformation.LastModifiedBy));
                System.Console.WriteLine(string.Format(" - LastPrinted: {0}", pptxDocument.DocumentInformation.LastPrinted));
                System.Console.WriteLine(string.Format(" - Modified: {0}", pptxDocument.DocumentInformation.Modified));
                System.Console.WriteLine(string.Format(" - Revision: {0}", pptxDocument.DocumentInformation.Revision));
                System.Console.WriteLine(string.Format(" - Subject: {0}", pptxDocument.DocumentInformation.Subject));
                System.Console.WriteLine(string.Format(" - Title: {0}", pptxDocument.DocumentInformation.Title));
                System.Console.WriteLine(string.Format(" - Version: {0}", pptxDocument.DocumentInformation.Version));
            }
        }

        // dispose images
        images.ClearAndDisposeItems();
    }
}


Rendering PPTX document pages

Each page of a PPTX document can be rendered, meaning it can be converted into an image.

Here's C# code that demonstrates how to render all pages of a PPTX document and save them as PNG files:
/// <summary>
/// Renders pages of PPTX document.
/// </summary>
/// <param name="pptxFilename">A name of PPTX file.</param>
public static void RenderPagesOfPptxDocument(string pptxFilename)
{
    // create image collection
    using (Vintasoft.Imaging.ImageCollection images = new Vintasoft.Imaging.ImageCollection())
    {
        // add PPTX document to the image collection
        images.Add(pptxFilename);

        // for each image in collection
        for (int i = 0; i < images.Count; i++)
        {
            // get image
            Vintasoft.Imaging.VintasoftImage image = images[i];

            // save image to a PNG file
            image.Save(string.Format("page{0}.png", i));
        }

        // dispose images
        images.ClearAndDisposeItems();
    }
}


Extracting text from PPTX document

Each page of PPTX document can contain text and graphics.

Here's C# code that demonstrates how to extract the text of all pages of PPTX document:
public static void ExtractPptxPageTextFromMetadataTree(string pptxFilename)
{
    // create image collection
    using (Vintasoft.Imaging.ImageCollection images = new Vintasoft.Imaging.ImageCollection())
    {
        // add PPTX document to the image collection
        images.Add(pptxFilename);

        // for each image in collection
        for (int i = 0; i < images.Count; i++)
        {
            // get image
            Vintasoft.Imaging.VintasoftImage image = images[i];

            // get PptxPageTextRegionMetadata object from the metadata tree of image
            Vintasoft.Imaging.Metadata.PptxPageTextRegionMetadata pptxPageTextRegionMetadata =
                image.Metadata.MetadataTree.FindChildNode<Vintasoft.Imaging.Metadata.PptxPageTextRegionMetadata>();
            // if PptxPageTextRegionMetadata object is found
            if (pptxPageTextRegionMetadata != null)
            {
                // get the text region from the PptxPageTextRegionMetadata object
                Vintasoft.Imaging.Text.TextRegion textregion = pptxPageTextRegionMetadata.GetTextRegion();
                // if text region is found
                if (textregion != null)
                {
                    // show information about text region
                    System.Console.WriteLine(string.Format("Page {0}, Text={1}", i, textregion.TextContent));
                }
            }
        }

        // dispose images
        images.ClearAndDisposeItems();
    }
}


Viewing a PPTX document in a WinForms application

The WinForms UI-control ImageViewer allows to view a PPTX document.
Here is C# code that demonstrates how to view a PPTX document in WinForms UI-control ImageViewer in a WinForms application:
...
// open PPTX file in WinForms image viewer
imageViewer1.Images.Add("PptxTestDocument.pptx");
...


Viewing a PPTX document in a WPF application

The WPF UI-control WpfImageViewer allows to view a PPTX document.
Here is C# code that demonstrates how to view a PPTX document in WPF UI-control WpfImageViewer in a WPF application:
...
// open PPTX file in WPF image viewer
wpfImageViewer1.Images.Add("PptxTestDocument.pptx");
...


Viewing a PPTX Document in a Web Application

The JavaScript UI-control WebImageViewerJS allows to view a PPTX document.
Here is JavaScript code that demonstrates how to view a PPTX document in JavaScript UI-control WebImageViewerJS in a web application:
...
var imageViewer1 = new Vintasoft.Imaging.UI.WebImageViewerJS("WebImageViewer1");
// open PPTX file in web image viewer
imageViewer1.get_Images().openFile("PptxTestDocument.pptx");
...


The JavaScript UI-control WebDocumentViewerJS also allows to view a PPTX document.
Here is JavaScript code that demonstrates how to view a PPTX document in JavaScript UI-control WebDocumentViewerJS in a web application:
...
// create the document viewer
var docViewer1 = new Vintasoft.Imaging.DocumentViewer.WebDocumentViewerJS(docViewerSettings);
...
// open PPTX file in web document viewer
docViewer1.openFile("PptxTestDocument.pptx");
...


Printing a PPTX Document

If you need to print a PPTX document in a WPF application, please read the article 'Printing Images in WPF'.

If you need to print a PPTX document in a WinForms or console application, please read the article 'Printing Images Using the System.Drawing Library'.


Converting a PPTX file to a PDF file

The process of converting a PPTX file to a PDF file consists of the following steps:

Here is C# code that demonstrates how to convert a PPTX file to a PDF file:
/// <summary>
/// Converts PPTX document to a PDF document using ImageCollection and PdfEncoder classes.
/// </summary>
public static void ConvertPptxToPdf(string pptxFileName, string pdfFileName)
{
    // specify that VintaSoft Imaging .NET SDK should use GDI+ for drawing of 2D graphics
    Vintasoft.Imaging.Drawing.Gdi.GdiGraphicsFactory.SetAsDefault();
    // specify that VintaSoft Imaging .NET SDK should use SkiaSharp for drawing of 2D graphics
    //Vintasoft.Imaging.Drawing.SkiaSharp.SkiaSharpDrawingFactory.SetAsDefault();

    // create image collection
    using (Vintasoft.Imaging.ImageCollection imageCollection = new Vintasoft.Imaging.ImageCollection())
    {
        // add PPTX document to collection
        imageCollection.Add(pptxFileName);

        // create pdfEncoder
        using (Vintasoft.Imaging.Codecs.Encoders.PdfEncoder pdfEncoder = 
            new Vintasoft.Imaging.Codecs.Encoders.PdfEncoder(true))
        {
            // set comression for image resources
            pdfEncoder.Settings.Compression = Vintasoft.Imaging.Codecs.Encoders.PdfImageCompression.Jpeg;

            // save images of image collection to PDF document using PdfEncoder
            imageCollection.SaveSync(pdfFileName, pdfEncoder);
        }

        // dispose images
        imageCollection.ClearAndDisposeItems();
    }
}


Converting a PPTX file to a multi-page TIFF file

The process of converting a PPTX file to a multi-page TIFF file consists of the following steps:

Here's C# code that demonstrates how to convert a PPTX file to a multi-page TIFF file:
/// <summary>
/// Converts PPTX document to TIFF file using ImageCollection and TiffEncoder classes.
/// PPTX document is rendered with specified resolution.
/// </summary>
public static void ConvertPptxToTiff(string pptxFileName, string tiffFileName, float dpi)
{
    // specify that VintaSoft Imaging .NET SDK should use GDI+ for drawing of 2D graphics
    Vintasoft.Imaging.Drawing.Gdi.GdiGraphicsFactory.SetAsDefault();
    // specify that VintaSoft Imaging .NET SDK should use SkiaSharp for drawing of 2D graphics
    //Vintasoft.Imaging.Drawing.SkiaSharp.SkiaSharpDrawingFactory.SetAsDefault();

    // create image collection
    using (Vintasoft.Imaging.ImageCollection imageCollection = new Vintasoft.Imaging.ImageCollection())
    {
        // add PPTX document to collection
        imageCollection.Add(pptxFileName);

        // set rendering settings
        imageCollection.SetRenderingSettings(new Vintasoft.Imaging.Codecs.Decoders.RenderingSettings(dpi, dpi));

        // create TiffEncoder
        using (Vintasoft.Imaging.Codecs.Encoders.TiffEncoder tiffEncoder = 
            new Vintasoft.Imaging.Codecs.Encoders.TiffEncoder(true))
        {
            // set TIFF compression to Zip
            tiffEncoder.Settings.Compression = 
                Vintasoft.Imaging.Codecs.ImageFiles.Tiff.TiffCompression.Zip;

            // save images of image collection to TIFF file using TiffEncoder
            imageCollection.SaveSync(tiffFileName, tiffEncoder);
        }

        // dispose images
        imageCollection.ClearAndDisposeItems();
    }
}


Converting a PPTX file to PNG files

The process of converting a PPTX file to PNG files consists of the following steps:

Here's C# code that demonstrates how to convert a PPTX file to PNG files:
/// <summary>
/// Converts pages of PPTX document to PNG files.
/// </summary>
public static void ConvertPptxToPng(string pptxFileName)
{
    // specify that VintaSoft Imaging .NET SDK should use GDI+ for drawing of 2D graphics
    Vintasoft.Imaging.Drawing.Gdi.GdiGraphicsFactory.SetAsDefault();
    // specify that VintaSoft Imaging .NET SDK should use SkiaSharp for drawing of 2D graphics
    //Vintasoft.Imaging.Drawing.SkiaSharp.SkiaSharpDrawingFactory.SetAsDefault();

    // create image collection
    using (Vintasoft.Imaging.ImageCollection images = new Vintasoft.Imaging.ImageCollection())
    {
        // add PPTX document to the image collection
        images.Add(pptxFileName);

        // create PNG encoder
        using (Vintasoft.Imaging.Codecs.Encoders.PngEncoder pngEncoder =
            new Vintasoft.Imaging.Codecs.Encoders.PngEncoder())
        {
            // for each page in PPTX document
            for (int i = 0; i < images.Count; i++)
            {
                // save rendered image to a PNG file
                images[i].Save(string.Format("page{0}.png", i), pngEncoder);
            }
        }

        // dispose images
        images.ClearAndDisposeItems();
    }
}


Converting a PPTX file to SVG files

The process of converting a PPTX file to SVG files consists of the following steps:

Here is C# code that demonstrates how to convert a PPTX file to SVG files:
/// <summary>
/// Converts PPTX document to the SVG files using ImageCollection and SvgEncoder classes.
/// </summary>
public static void ConvertPptxToSvg(string pptxFileName)
{
    // specify that VintaSoft Imaging .NET SDK should use GDI+ for drawing of 2D graphics
    Vintasoft.Imaging.Drawing.Gdi.GdiGraphicsFactory.SetAsDefault();
    // specify that VintaSoft Imaging .NET SDK should use SkiaSharp for drawing of 2D graphics
    //Vintasoft.Imaging.Drawing.SkiaSharp.SkiaSharpDrawingFactory.SetAsDefault();

    // create image collection
    using (Vintasoft.Imaging.ImageCollection images = new Vintasoft.Imaging.ImageCollection())
    {
        // add PPTX document to the image collection
        images.Add(pptxFileName);

        // create SVG encoder
        using (Vintasoft.Imaging.Codecs.Encoders.SvgEncoder svgEncoder =
            new Vintasoft.Imaging.Codecs.Encoders.SvgEncoder())
        {
            // specify that SVG encoder should compress embedded image using PNG compression
            svgEncoder.Settings.EmbeddedImageEncoder = new Vintasoft.Imaging.Codecs.Encoders.PngEncoder();

            // for each page in PPTX document
            for (int i = 0; i < images.Count; i++)
            {
                // save page to SVG file
                images[i].Save(string.Format("page{0}.svg", i), svgEncoder);
            }
        }

        // dispose images
        images.ClearAndDisposeItems();
    }
}