PPT PPTX ODP POT ppsx
Aspose.Slides  for Python via .NET
PPT

Chỉnh sửa thuộc tính PPT bằng Python

Xây dựng các ứng dụng Python của riêng bạn để sửa đổi các thuộc tính Tích hợp và Tùy chỉnh trong tệp bản trình bày bằng cách sử dụng API phía máy chủ.

Sửa đổi Thuộc tính PPT qua Python

Khi sử dụng Aspose.Slides for Python via .NET, nhà phát triển có thể truy cập và sửa đổi giá trị của thuộc tính tích hợp cũng như thuộc tính tùy chỉnh. Nhà phát triển có thể sử dụng thuộc tính DocumentProperties do đối tượng Bản trình bày hiển thị để truy cập các thuộc tính tài liệu của tệp bản trình bày.

Sửa đổi Thuộc tính tích hợp PPT - Python


import aspose.slides as slides

# Instantiate the Presentation class that represents the Presentation
with slides.Presentation(path + "ModifyBuiltinProperties.ppt") as presentation:
    # Create a reference to object associated with Presentation
    documentProperties = presentation.document_properties

    # Set the builtin properties
    documentProperties.author = "Aspose.Slides for Python"
    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.ppt", slides.export.SaveFormat.PPT)

Thêm thuộc tính tùy chỉnh vào PPT - Python


import aspose.slides as slides

# Instantiate the Presentation class
with slides.Presentation() as presentation:
    # Getting Document Properties
    documentProperties = presentation.document_properties

    # Adding Custom properties
    documentProperties.set_custom_property_value("New Custom", 12)
    documentProperties.set_custom_property_value("My Nam", "Aspose Metadata Editor")
    documentProperties.set_custom_property_value("Custom", 124)

    # Getting property name at particular index
    getPropertyName = documentProperties.get_custom_property_name(2)

    # Removing selected property
    documentProperties.remove_custom_property(getPropertyName)

    # Saving presentation
    presentation.save("CustomDocumentProperties_out.ppt", slides.export.SaveFormat.PPT)

Cách trích xuất siêu dữ liệu của PPT qua Python

Đây là các bước để Trích xuất siêu dữ liệu từ tệp PPT.

  1. Khởi tạo lớp Trình bày với đường dẫn đến tệp PPT

  2. Nhận đối tượng DocumentProperties được liên kết với Bản trình bày

  3. Lặp lại các mục trong đối tượng DocumentProperties

  4. Truy cập và sửa đổi thuộc tính tùy chỉnh

Các định dạng siêu dữ liệu được hỗ trợ khác

Sử dụng Python, Bạn cũng có thể thao tác với siêu dữ liệu của nhiều định dạng khác bao gồm.