VintaSoft Imaging .NET SDK 15.2: Documentation for .NET developer
Vintasoft.Imaging.Office.OpenXml.Pptx Namespace / PptxPageCollection Class
Members Object Syntax Example Hierarchy Requirements SeeAlso
In This Topic
PptxPageCollection Class
In This Topic
Represents a collection of PptxPage objects.
Object Model
PptxPage PptxPageCollection
Syntax
Example

Here is an example that shows how to render all pages of PPTX document and save rendered images to PNG files:


''' <summary>
''' Renders all pages of PPTX document and saves rendered images to PNG files.
''' </summary>
''' <param name="filename">A name of PPTX file.</param>
Public Shared Sub RenderAndSavePptxPages(filename As String)
    ' open PPTX document
    Using pptxDocument As New Vintasoft.Imaging.Office.OpenXml.Pptx.PptxDocument(filename, System.IO.FileMode.Open, System.IO.FileAccess.Read)
        ' for each PPTX page
        For i As Integer = 0 To pptxDocument.Pages.Count - 1
            ' render PPTX page
            Using renderedPage As Vintasoft.Imaging.VintasoftImage = pptxDocument.Pages(i).Render()
                ' save rendered image to a PNG file
                renderedPage.Save(String.Format("page{0}.png", i))
            End Using
        Next
    End Using
End Sub


/// <summary>
/// Renders all pages of PPTX document and saves rendered images to PNG files.
/// </summary>
/// <param name="filename">A name of PPTX file.</param>
public static void RenderAndSavePptxPages(string filename)
{
    // open PPTX document
    using (Vintasoft.Imaging.Office.OpenXml.Pptx.PptxDocument pptxDocument =
        new Vintasoft.Imaging.Office.OpenXml.Pptx.PptxDocument(filename, System.IO.FileMode.Open, System.IO.FileAccess.Read))
    {
        // for each PPTX page
        for (int i = 0; i < pptxDocument.Pages.Count; i++)
        {
            // render PPTX page
            using (Vintasoft.Imaging.VintasoftImage renderedPage = pptxDocument.Pages[i].Render())
            {
                // save rendered image to a PNG file
                renderedPage.Save(string.Format("page{0}.png", i));
            }
        }
    }
}

Inheritance Hierarchy
Requirements

Target Platforms: .NET 11; .NET 10; .NET 9; .NET 8; .NET 6; .NET Framework 4.8, 4.7, 4.6, 4.5, 4.0, 3.5

See Also