WriteAsSvg

WriteAsSvg(Stream)

Saves the slide content as an SVG file.

public void WriteAsSvg(Stream stream)
ParameterTypeDescription
streamStreamTarget stream

Examples

The following code example demonstrates how to convert the first slide from a PowerPoint presentation into an SVG file.

[C#]
using (Presentation pres = new Presentation("pres.pptx"))
{
    using (Stream fileStream = System.IO.File.Create("slide_1.svg"))
    {
        // Saves the first slide as an SVG file
        pres.Slides[0].WriteAsSvg(fileStream);
    }
}

See Also


WriteAsSvg(Stream, ISVGOptions)

Saves the slide content as an SVG file.

public void WriteAsSvg(Stream stream, ISVGOptions svgOptions)
ParameterTypeDescription
streamStreamTarget stream
svgOptionsISVGOptionsSVG generation options

Examples

The following code example demonstrates how to convert the first slide from a PowerPoint presentation into an SVG file with options.

[C#]
using (Presentation pres = new Presentation("pres.pptx"))
{
    using (Stream fileStream = System.IO.File.Create("slide_1.svg"))
    {
        var options = new SVGOptions() { VectorizeText = true };
        // Saves the first slide as an SVG file
        pres.Slides[0].WriteAsSvg(fileStream, options);
    }
}

See Also