How to Hide a Slide in Presentation using C#

In this simple article, we will exhibit how to hide a slide in Presentation using C# without any dependence on PowerPoint. You don’t require any third-party software or an Interop library for hiding a PPTX slide in C#. The application is useful and can be referred in any of the .NET configured environments inside Linux, Windows or macOS to hide the desired slide or slides inside the presentation.

Steps to Hide a Slide in PPTX in C#

  1. Set up your application to install Aspose.Slides for .NET from the NuGet package manager
  2. Load the source presentation using the Presentation class to hide the slide inside the presentation
  3. Access the second slide inside the presentation slides collection and hide the slide by setting the Slide.Hidden property
  4. Save the presentation with hidden slides on the disk

By using the above steps in C# hiding a PPTX slide inside the desired presentation can be easily done. The process starts by loading the source presentation file from the disk using an instance of the Presentation class. Then desired slide or slides inside the presentation slides collection will be accessed and using Slide.Hidden property to true will hide the selected slide or slides. Finally, the presentation with hidden slide will be saved on the disk.

Code to Hide a Slide in Presentation in C#

The above example code easily hide a slide in PPTX in C# using a very simple API interface. You can access desired number of multiple slides and can even hide them as well in your application using the same property individually for every slide. Finally, you can either save the presentation in PPT, PPTX or ODP formats either on the disk or inside a memory stream depending on your application requirements.

This topic entails how to hide a slide in Presentation in C#. If you are interested in learning about inserting an SVG image inside the presentation slide, refer to the article on how to convert SVG to Presentation using C#.

 English