本文整理汇总了Python中com.aspose.slides.Presentation.getDocumentProperties方法的典型用法代码示例。如果您正苦于以下问题:Python Presentation.getDocumentProperties方法的具体用法?Python Presentation.getDocumentProperties怎么用?Python Presentation.getDocumentProperties使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.aspose.slides.Presentation
的用法示例。
在下文中一共展示了Presentation.getDocumentProperties方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_properties
# 需要导入模块: from com.aspose.slides import Presentation [as 别名]
# 或者: from com.aspose.slides.Presentation import getDocumentProperties [as 别名]
def get_properties(dataDir):
dataDir = Settings.dataDir + 'WorkingWithPresentation/Properties/'
# Instantiate the Presentation class that represents the presentation
pres = Presentation(dataDir + "HelloWorld.pptx")
# Create a reference to IDocumentProperties object associated with Presentation
dp = pres.getDocumentProperties()
# Display the builtin properties
print "Category : " + dp.getCategory()
print "Current Status : " + dp.getContentStatus()
print "Creation Date : "
dp.getCreatedTime()
print "Author : " + dp.getAuthor()
print "Description : " + dp.getComments()
print "KeyWords : " + dp.getKeywords()
print "Last Modified By : " + dp.getLastSavedBy()
print "Supervisor : " + dp.getManager()
print "Modified Date : "
dp.getLastSavedTime()
print "Presentation Format : "
dp.getPresentationFormat()
print "Last Print Date : "
dp.getLastPrinted()
print "Is Shared between producers : "
dp.getSharedDoc()
print "Subject : "
dp.getSubject()
print "Title : "
dp.getTitle()
示例2: add_custom_properties
# 需要导入模块: from com.aspose.slides import Presentation [as 别名]
# 或者: from com.aspose.slides.Presentation import getDocumentProperties [as 别名]
def add_custom_properties(dataDir):
dataDir = Settings.dataDir + 'WorkingWithPresentation/Properties/'
#Instantiate the Presentation class that represents the presentation
pres = Presentation(dataDir + "HelloWorld.pptx")
# Getting Document Properties
dp = pres.getDocumentProperties()
# Adding Custom properties
dp.set_Item("New Custom" , 12)
dp.set_Item("My Name","Mudassir")
dp.set_Item("Custom", 124)
# Saving presentation
save_format = SaveFormat
pres.save(dataDir + "CustomDemo.pptx", save_format.Pptx)
print "Added custom properties, please check output file."
示例3: remove_property
# 需要导入模块: from com.aspose.slides import Presentation [as 别名]
# 或者: from com.aspose.slides.Presentation import getDocumentProperties [as 别名]
def remove_property(dataDir):
dataDir = Settings.dataDir + 'WorkingWithPresentation/Properties/'
# Instantiate the Presentation class that represents the presentation
pres = Presentation(dataDir + "HelloWorld.pptx")
# Getting Document Properties
dp = pres.getDocumentProperties()
# Getting property name at particular index
property_name = dp.getPropertyName(2)
# Removing selected property
dp.remove(property_name)
# Saving presentation
save_format = SaveFormat
pres.save(dataDir + "RemoveDP.pptx", save_format.Pptx)
print "Remove document property, please check output file."
示例4: update_properties
# 需要导入模块: from com.aspose.slides import Presentation [as 别名]
# 或者: from com.aspose.slides.Presentation import getDocumentProperties [as 别名]
def update_properties(dataDir):
dataDir = Settings.dataDir + 'WorkingWithPresentation/Properties/'
# Instantiate the Presentation class that represents the presentation
pres = Presentation(dataDir + "HelloWorld.pptx")
# Create a reference to IDocumentProperties object associated with Presentation
dp = pres.getDocumentProperties()
# Set the builtin properties
dp.setAuthor ("Aspose.Slides for Java")
dp.setTitle ("Modifying Presentation Properties")
dp.setSubject ( "Aspose Subject")
dp.setComments ( "Aspose Description")
dp.setManager ( "Aspose Manager")
# Save your presentation to a file
save_format = SaveFormat
pres.save(dataDir + "DocProps.pptx", save_format.Pptx)
print "Properties have been updated, Please check output file."