Compress PowerPoint Presentation Size using C#

This guide explains how to compress PowerPoint presentation size using C#. It shares details on setting up the IDE, a list of step-by-step tasks, and sample code for reducing PowerPoint file size using C#. Further improvements in the code are also suggested at the end of the article for creating a more compressed PPT/PPTX file.

Steps to Reduce PPTX Size using C#

  1. Set the environment to use Aspose.Slides for .NET to reduce PPTX size
  2. Load the PowerPoint presentation, minimize the resolution of every picture on the slides, layouts and masters, including pictures inside groups
  3. Remove the hidden and cropped-out parts of each picture on the slide
  4. Convert all the images to JPEG format; if different, set medium quality, and keep the new version if its size is smaller
  5. Remove the unused master and layout slides
  6. Shrink embedded fonts to maintain only the characters used in the presentation
  7. Save the resultant presentation and display the reduction results

These steps guide how to shrink PowerPoint file size using C#. Load the presentation and downsample pictures on all the slides, layout slides, and master slides. Remove all unused masters/layouts and unused font characters, and save the updated presentation as PPTX or PPT.

Code to Decrease PPT Size using C#

This code shows how to minimize PowerPoint file size using C#. You can use built-in compression levels (330, 220, 150, 96, or 72 DPI) instead of a hard-coded number, compress pictures in the background instead of picture frames as in the sample code, and increase the ZIP compression on save. Try turning off thumbnail regeneration on save to stop a new preview image from being written into the file.

This article shows how to compress the PPT or PPTX file. To add SmartArt in a presentation, refer to the article Add Smart Art for PowerPoint using C#.