Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save aspose-com-kb/de57aff244bda235db18f97a6d0ca6b5 to your computer and use it in GitHub Desktop.
Save aspose-com-kb/de57aff244bda235db18f97a6d0ca6b5 to your computer and use it in GitHub Desktop.
How to Create Readonly Presentation using Python. For more details: https://kb.aspose.com/slides/python/how-to-create-readonly-presentation-using-python/
import aspose.slides as slides
#Path to the license and presentation files directory
filepath = "Y://Documents//KnowledgeBase//TestData//"
#Load the license in your application for creating a read only presentation
slidesTextLicense = slides.License()
slidesTextLicense.set_license(filepath + "Conholdate.Total.Product.Family.lic")
#Create a Presentation object to access the target presentation file
with slides.Presentation(filepath + "Source.pptx") as presSecurity:
# Apply the presentation access to read only
presSecurity.ProtectionManager.read_only_recommended = True
#Save the read only presentation on the disk
presSecurity.save("ReadOnlyPresentation.pptx", slides.export.SaveFormat.PPTX)
print("Done")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment