Save a modified file to the original source

This example shows how to save the modified content back to the underlying source. Call save() with no arguments — the changes are written back to the file (or stream) the document was loaded from.

from groupdocs.metadata import Metadata


def save_file_to_original_source():
    with Metadata("input.ppt") as metadata:
        # Edit or remove metadata here
        removed = metadata.sanitize()
        print(f"Removed {removed} properties")

        # Saves the document back to the underlying source (stream or file)
        metadata.save()


if __name__ == "__main__":
    save_file_to_original_source()
Binary file (PPT, 172 KB)

Download full output

See also

More resources

GitHub examples

You may easily run the code above and see the feature in action in our GitHub examples:

Free online document metadata management App

You are welcome to view and edit metadata of PDF, DOC, DOCX, PPT, PPTX, XLS, XLSX, emails, images and more with our free online Free Online Document Metadata Viewing and Editing App.