DocumentProperties

DocumentProperties — Aspose.Slides FOSS for Python API Reference

DocumentProperties exposes the metadata stored in a .pptx file: core properties (title, author, keywords), application properties (slide count, total editing time), and an extensible set of custom properties.

Access via prs.document_properties.

Package: aspose.slides_foss


DocumentProperties

Core Properties (core.xml)

PropertyTypeAccessDescription
titlestrRead/WritePresentation title.
subjectstrRead/WriteSubject description.
authorstrRead/WriteAuthor / creator name.
keywordsstrRead/WriteSpace- or comma-separated keyword list.
commentsstrRead/WriteFree-text description (maps to dc:description).
categorystrRead/WriteContent category.
content_statusstrRead/WriteWorkflow status (e.g. "Draft", "Final").
content_typestrRead/WriteMIME or document type.
last_saved_bystrRead/WriteDisplay name of the person who last saved the file.
revision_numberintRead/WriteSave-count revision number.
created_timedatetimeRead/WriteUTC creation timestamp.
last_saved_timedatetimeRead/WriteUTC last-modified timestamp.
last_printeddatetimeRead/WriteUTC time of the last print.

Application Properties (app.xml — read-mostly)

PropertyTypeAccessDescription
app_versionstrReadApplication version string (e.g. "16.0000").
name_of_applicationstrRead/WriteCreating application name.
companystrRead/WriteCompany name.
managerstrRead/WriteManager field.
presentation_formatstrRead/WriteIntended presentation format description.
application_templatestrRead/WriteTemplate file name.
hyperlink_basestrRead/WriteBase URL for relative hyperlinks.
total_editing_timetimedeltaRead/WriteCumulative time the file was open for editing.
shared_docboolRead/WriteWhether the document is shared.
scale_cropboolRead/WriteThumbnail scaling mode.
links_up_to_dateboolRead/WriteWhether external links have been refreshed.
hyperlinks_changedboolRead/WriteWhether hyperlinks were modified in this part.

Statistics (read-only)

PropertyTypeDescription
slidesintTotal number of slides.
hidden_slidesintNumber of hidden slides.
notesintNumber of slides that have notes.
paragraphsintTotal paragraph count across all text frames.
wordsintTotal word count.
multimedia_clipsintNumber of audio/video clips embedded.

Structural read-only properties

PropertyTypeDescription
heading_pairslist[IHeadingPair]Document section groupings from app.xml. Each item has .name (str) and .count (int).
titles_of_partslist[str]Titles of each named section in the document.

Custom Properties

Custom properties are arbitrary name-value pairs stored in docProps/custom.xml.

MethodSignatureDescription
set_custom_property_valueset_custom_property_value(name, value)Set a custom property. value may be str, int, float, bool, or datetime.
get_custom_property_valueget_custom_property_value(name, out_list)Retrieve a value by name into out_list[0]. The list is cleared then populated.
get_custom_property_nameget_custom_property_name(index) -> strReturn the name of the custom property at index.
remove_custom_propertyremove_custom_property(name) -> boolRemove a custom property by name. Returns True if found and removed.
contains_custom_propertycontains_custom_property(name) -> boolCheck whether a named custom property exists.
clear_custom_propertiesclear_custom_properties()Remove all custom properties.
count_of_custom_propertiesint (property)Number of custom properties currently stored.

Built-in Property Operations

MethodDescription
clear_built_in_properties()Reset all core and app properties to their defaults.

Usage Example

Read and write presentation metadata

import aspose.slides_foss as slides
from aspose.slides_foss.export import SaveFormat
from datetime import datetime, timezone

with slides.Presentation() as prs:
    props = prs.document_properties

    # Core properties
    props.title = "Q3 Financial Review"
    props.author = "Finance Team"
    props.subject = "Quarterly earnings presentation"
    props.keywords = "finance Q3 earnings revenue"
    props.category = "Finance"
    props.content_status = "Draft"
    props.company = "Acme Corp"
    props.revision_number = 1

    # Custom properties
    props.set_custom_property_value("DeckVersion", "1.0.0")
    props.set_custom_property_value("ReviewedBy", "Alice")
    props.set_custom_property_value("ApprovedForRelease", False)

    prs.save("with-metadata.pptx", SaveFormat.PPTX)


# Read back
with slides.Presentation("with-metadata.pptx") as prs:
    props = prs.document_properties
    print(f"Title: {props.title}")
    print(f"Author: {props.author}")
    print(f"Slides: {props.slides}")

    # Read a custom property
    out = []
    props.get_custom_property_value("DeckVersion", out)
    if out:
        print(f"DeckVersion: {out[0]}")

See Also