Last active
June 2, 2023 04:23
-
-
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/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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