Convert Powerpoint PPT to JPG

About PowerPoint to JPG Conversion

With Aspose.Slides .NET API you can convert PowerPoint PPT or PPTX presentation to JPG image. It is also possible to convert PPT/PPTX to BMP, PNG or SVG. With this features it’s easy to implement your own presentation viewer, create  the thumbnail for every slide. This may be useful if you want to protect presentation slides from copywriting, demonstrate presentation in read-only mode. Aspose.Slides allows to convert the whole presentation or a certain slide into image formats. 

Convert PowerPoint PPT/PPTX to JPG

Here are the steps to convert PPT/PPTX to JPG:

using (Presentation pres = new Presentation("PowerPoint-Presentation.ppt"))
{
	foreach (ISlide sld in pres.Slides)
	{
		// Create a full scale image
		Bitmap bmp = sld.GetThumbnail(1f, 1f);

		// Save the image to disk in JPEG format
		bmp.Save(string.Format("Slide_{0}.jpg", sld.SlideNumber), System.Drawing.Imaging.ImageFormat.Jpeg);
	}
}

Convert PowerPoint PPT/PPTX to JPG with Customized Dimensions

To change the dimension of the resulting thumbnail and JPG image, you can set the ScaleX and ScaleY for it. To do that, pass ScaleX and ScaleY values into ISlide.GetThumbnail(float scaleX, float scaleY) method:

using (Presentation pres = new Presentation("PowerPoint-Presentation.pptx"))
{
	// Define dimensions
	int desiredX = 1200;
	int desiredY = 800;
	// Get scaled values of X and Y
	float ScaleX = (float)(1.0 / pres.SlideSize.Size.Width) * desiredX;
	float ScaleY = (float)(1.0 / pres.SlideSize.Size.Height) * desiredY;

	foreach (ISlide sld in pres.Slides)
	{
		// Create a full scale image
		Bitmap bmp = sld.GetThumbnail(ScaleX, ScaleY);

		// Save the image to disk in JPEG format
		bmp.Save(string.Format("Slide_{0}.jpg", sld.SlideNumber), System.Drawing.Imaging.ImageFormat.Jpeg);
	}
}

Render Comments when saving Presentation into Image

Aspose.Slides for .NET provides a facility to render comments of presentations or slide when converting those into images.  An example is given below that shows how to render comments of presentation into an image.

Presentation pres = new Presentation("test.pptx");
Bitmap bmp = new Bitmap(740, 960);

IRenderingOptions opts = new RenderingOptions();
opts.NotesCommentsLayouting.NotesPosition = NotesPositions.BottomTruncated;
opts.NotesCommentsLayouting.CommentsAreaColor = Color.Red;
opts.NotesCommentsLayouting.CommentsAreaWidth = 200;
opts.NotesCommentsLayouting.CommentsPosition = CommentsPositions.Right;

using (Graphics graphics = Graphics.FromImage(bmp))
{
	pres.Slides[0].RenderToGraphics(opts, graphics);
}
bmp.Save("OutPresBitmap.png", ImageFormat.Png);
System.Diagnostics.Process.Start("OutPresBitmap.png");

See also

See other options to convert PPT/PPTX into image, like: