Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save aspose-com-kb/bd56fe44203edc7ed6c48ab8fa685547 to your computer and use it in GitHub Desktop.
Save aspose-com-kb/bd56fe44203edc7ed6c48ab8fa685547 to your computer and use it in GitHub Desktop.
How to Create Readonly Presentation using C#. For more details: https://kb.aspose.com/slides/net/how-to-create-readonly-presentation-using-csharp/
using System;
using Aspose.Slides;
using Aspose.Slides.Export;
namespace TestSlides
{
public class ReadonlyPresentation
{
public static void ApplyReadOnly()
{
String path = @"/Users/KnowledgeBase/TestData/";
// Setting the license for the product to make the presentation readonly
License SlidesLicense = new License();
SlidesLicense.SetLicense(path + "Conholdate.Total.Product.Family.lic");
// Load the source presentation file to make it readonly
using (Presentation presSecurity = new Presentation(path + "Source.pptx"))
{
// Set the presentation access to readonly
presSecurity.ProtectionManager.ReadOnlyRecommended = true;
// Save the readonly presentation on the disk
presSecurity.Save(path + "SecurePres.pptx", SaveFormat.Pptx);
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment