Skip to content

Instantly share code, notes, and snippets.

Revisions

  1. aspose-com-kb revised this gist Jun 2, 2023. No changes.
  2. aspose-com-kb revised this gist May 27, 2023. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion How to Create Readonly Presentation using C#.cs
    Original file line number Diff line number Diff line change
    @@ -10,7 +10,7 @@ public static void ApplyReadOnly()
    {
    String path = @"/Users/KnowledgeBase/TestData/";

    // Setting the linence for the product to make the presentation readonly
    // Setting the license for the product to make the presentation readonly
    License SlidesLicense = new License();
    SlidesLicense.SetLicense(path + "Conholdate.Total.Product.Family.lic");

  3. aspose-com-kb created this gist May 27, 2023.
    29 changes: 29 additions & 0 deletions How to Create Readonly Presentation using C#.cs
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,29 @@
    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 linence 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);
    }

    }
    }
    }