ToPng

ToPng(Presentation, string)

Converts the input presentation to a set of PNG format images. If the output file name is given as “myPath/myFilename.png”, the result will be saved as a set of “myPath/myFilename_N.png” files, where N is a slide number.

public static void ToPng(Presentation pres, string outputFileName)
ParameterTypeDescription
presPresentationThe input presentation.
outputFileNameStringThe output file name.

Exceptions

exceptioncondition
ArgumentException

Examples

using (var pres = new Presentation("pres.pptx"))
   Convert.ToPng(pres, "presImage.png");

See Also


ToPng(Presentation, string, Size)

Converts the input presentation to a set of PNG format images. If the output file name is given as “myPath/myFilename.png”, the result will be saved as a set of “myPath/myFilename_N.png” files, where N is a slide number.

public static void ToPng(Presentation pres, string outputFileName, Size imageSize)
ParameterTypeDescription
presPresentationThe input presentation
outputFileNameStringThe output file name.
imageSizeSizeThe size of each generated image.

Exceptions

exceptioncondition
ArgumentException

Examples

using (var pres = new Presentation("pres.pptx"))
    Convert.ToPng(pres, "presImage.png", new Size(720, 540));

See Also


ToPng(Presentation, string, float, IRenderingOptions)

Converts the input presentation to a set of PNG format images. If the output file name is given as “myPath/myFilename.png”, the result will be saved as a set of “myPath/myFilename_N.png” files, where N is a slide number.

public static void ToPng(Presentation pres, string outputFileName, float scale, 
    IRenderingOptions options)
ParameterTypeDescription
presPresentationThe input presentation.
outputFileNameStringThe output file name.
scaleSingleThe scaling factor applied to the output images relative to the original slide size.
optionsIRenderingOptionsThe rendering options.

Exceptions

exceptioncondition
ArgumentException

Examples

IRenderingOptions options = new RenderingOptions()
{
    SlidesLayoutOptions = new NotesCommentsLayoutingOptions()
    {
        NotesPosition = NotesPositions.BottomTruncated
    }
};

using (var pres = new Presentation("pres.pptx"))
   Convert.ToPng(pres, "presImage.png", 2f, options);

See Also