Examine Presentation
Aspose.Slides for Python via .NET allows you to examine a presentation to find out its properties and understand its behavior.
Info
The PresentationInfo and DocumentProperties classes contain the properties and methods used in operations here.Check a Presentation Format
Before working on a presentation, you may want to find out what format (PPT, PPTX, ODP, and others) the presentation is in at the moment.
You can check a presentation’s format without loading the presentation. See this Python code:
import aspose.slides as slides
info1 = slides.PresentationFactory.instance.get_presentation_info("pres.pptx")
print(info1.load_format, info1.load_format == slides.LoadFormat.PPTX)
info2 = slides.PresentationFactory.instance.get_presentation_info("pres.odp")
print(info2.load_format, info2.load_format == slides.LoadFormat.ODP)
info3 = slides.PresentationFactory.instance.get_presentation_info("pres.ppt")
print(info3.load_format, info3.load_format == slides.LoadFormat.PPT)
Get a Presentation Properties
This Python code shows you how to get a presentation’s properties (information about the presentation):
import aspose.slides as slides
info = slides.PresentationFactory.instance.get_presentation_info("pres.pptx")
props = info.read_document_properties()
print(props.created_time)
print(props.subject)
print(props.title)
You may want to see the properties under the DocumentProperties class.
Update a Presentation Properties
Aspose.Slides provides the PresentationInfoUpdateDocumentProperties method that allows you to make changes to a presentation’s properties.
This Python code shows you how to edit a presentation’s properties:
import aspose.slides as slides
info = slides.PresentationFactory.instance.get_presentation_info("pres.pptx")
props = info.read_document_properties()
print(props.title)
props.title = "My title"
info.update_document_properties(props)
print(props.title)
Useful Links
To get more information about a presentation and its security attributes, you may find these links useful: