PPT
PPTX
ODP
POT
ppsx
POT
使用 C# 编辑 POT 属性
构建您自己的 .NET 应用程序,以使用服务器端 API 修改演示文稿文件中的内置和自定义属性。
通过 C# 修改 POT 属性
使用 Aspose.Slides for .NET,开发人员可以访问和修改内置属性以及自定义属性的值。开发人员可以使用 Presentation 对象公开的 DocumentProperties 属性来访问演示文件的文档属性。
修改 POT 内置属性 - C#
// Instantiate the Presentation class that represents the Presentation
Presentation presentation = new Presentation("presentation.pot");
// Create a reference to IDocumentProperties object associated with Presentation
IDocumentProperties documentProperties = presentation.DocumentProperties;
// Set the builtin properties
documentProperties.Author = "Aspose.Slides for .NET";
documentProperties.Title = "Modifying Presentation Properties";
documentProperties.Subject = "Aspose Subject";
documentProperties.Comments = "Aspose Description";
documentProperties.Manager = "Aspose Manager";
// Save your presentation to a file
presentation.Save("DocumentProperties_out.pot", SaveFormat.Pot);
将自定义属性添加到 POT - C#
// Instantiate the Presentation class
Presentation presentation = new Presentation();
// Getting Document Properties
IDocumentProperties documentProperties = presentation.DocumentProperties;
// Adding Custom properties
documentProperties["New Custom"] = 12;
documentProperties["My Name"] = "Aspose Metadata Editor";
documentProperties["Custom"] = 124;
// Getting property name at particular index
String getPropertyName = documentProperties.GetCustomPropertyName(2);
// Removing selected property
documentProperties.RemoveCustomProperty(getPropertyName);
// Save your presentation to a file
presentation.Save("CustomDocumentProperties_out.pot", SaveFormat.Pot);
如何通过 C# 提取 POT 的元数据
这些是从 POT 文件中提取元数据的步骤。
使用 POT 文件的路径实例化 Presentation 类
获取与 Presentation 关联的 DocumentProperties 对象
遍历 DocumentProperties 对象中的项目
访问和修改自定义属性