使用 Python 檢視和編輯 PPS 中繼資料
建置使用 Aspose.Slides 讀取和修改簡報內建屬性與自訂屬性的 Python 應用程式。
使用 Python 檢視和修改 PPS 中繼資料
透過
Aspose.Slides for Python via .NET
,可以讀取和更新 PPS 簡報的內建中繼資料,並新增、更新或移除自訂文件屬性。透過 Presentation.document_properties 存取
IDocumentProperties
物件,修改後將簡報儲存為 PPS 格式。
更新 PPS 內建屬性 - Python
with slides.Presentation("presentation.pps") as presentation:
document_properties = presentation.document_properties
document_properties.author = "Aspose.Slides for Python"
document_properties.title = "Quarterly Review"
document_properties.subject = "Presentation Metadata"
document_properties.comments = "Built-in properties updated with Aspose.Slides."
document_properties.manager = "Project Manager"
presentation.save("presentation_with_updated_metadata.pps", slides.export.SaveFormat.PPS)新增和移除 PPS 自訂屬性 - Python
with slides.Presentation("presentation.pps") as presentation:
document_properties = presentation.document_properties
document_properties.set_custom_property_value("Department", "Engineering")
document_properties.set_custom_property_value("Review Count", 3)
document_properties.set_custom_property_value("Obsolete Status", "Draft")
document_properties.remove_custom_property("Obsolete Status")
presentation.save("presentation_with_custom_metadata.pps", slides.export.SaveFormat.PPS)如何使用 Python 編輯 PPS 中繼資料
依照下列步驟編輯 PPS 檔案的中繼資料。
- 使用
Presentation開啟 PPS 檔案。 - 透過
Presentation.document_properties存取其IDocumentProperties物件。 - 更新內建屬性,或對自訂屬性使用
set_custom_property_value和remove_custom_property。 - 使用
Presentation.save和SaveFormat.PPS儲存簡報。
以 Aspose.Slides 建置
線上檢視和編輯 PPS 中繼資料
免費的 Aspose.Slides Metadata 應用程式以 Aspose.Slides for Python via .NET 建置,與上方程式碼使用的是同一個 API。開啟它,看看 API 能如何處理您自己的 PPS 檔案。
- 在瀏覽器中執行,無需安裝任何軟體。
- 在撰寫程式碼之前,先看看 Aspose.Slides 如何讀寫屬性。
- 檢視和編輯 PPS 檔案的內建屬性與自訂屬性。
- 儲存並下載更新後的檔案。
其他支援的中繼資料格式
使用 Python,也可以管理其他支援的簡報格式的中繼資料。