CompressPresentation
Compress.CompressPresentation method
Reduces the size of a presentation by applying all available compression steps:
- Removes unused master slides
RemoveUnusedMasterSlides. - Removes unused layout slides
RemoveUnusedLayoutSlides. - Keeps only the glyphs actually used in embedded fonts
CompressEmbeddedFonts. - Reduces picture resolution to 150 DPI and deletes cropped areas of pictures
CompressImages.
public static void CompressPresentation(Presentation presentation)
| Parameter | Type | Description |
|---|---|---|
| presentation | Presentation | The presentation to compress. |
Exceptions
| exception | condition |
|---|---|
| ArgumentNullException | presentation is null. |
Remarks
To customize compression, for example to use a different picture resolution or to skip a step, call the methods listed above individually instead of this one. Cropped areas of pictures are removed permanently and cannot be restored in PowerPoint.
Examples
using (Presentation pres = new Presentation("pres.pptx"))
{
Aspose.Slides.LowCode.Compress.CompressPresentation(pres);
pres.Save("pres-out.pptx", SaveFormat.Pptx);
}
See Also
- class Presentation
- class Compress
- namespace Aspose.Slides.LowCode
- assembly Aspose.Slides