VintaSoft Imaging .NET SDK 15.1: Documentation for .NET developer
In This Topic
Codecs: How to convert PPTX to SVG?
In This Topic
VintaSoft Imaging .NET SDK can render PPTX page in vector form and save vector content to a SVG file.

For executing code below it is necessary:
Here is C#/VB.NET code that shows how to convert PPTX document to a SVG file(s) using ImageCollection and SvgEncoder classes:
/// <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();
    }
}
''' <summary>
''' Converts PPTX document to the SVG files using ImageCollection and SvgEncoder classes.
''' </summary>
Public Shared Sub ConvertPptxToSvg(pptxFileName As String)
    ' 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 images As New Vintasoft.Imaging.ImageCollection()
        ' add PPTX document to the image collection
        images.Add(pptxFileName)

        ' create SVG encoder
        Using svgEncoder As 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 i As Integer = 0 To images.Count - 1
                ' save page to SVG file
                images(i).Save(String.Format("page{0}.svg", i), svgEncoder)
            Next
        End Using

        ' dispose images
        images.ClearAndDisposeItems()
    End Using
End Sub