Last active
June 9, 2023 14:06
-
-
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/
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