Last active
June 9, 2023 14:06
How to Create Readonly Presentation using Python. For more details: https://kb.aspose.com/slides/python/how-to-create-readonly-presentation-using-python/
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
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