OpcPackage

Overview

OpcPackage is a class in Aspose.Slides for Python.

Manages an Open Packaging Conventions (OPC) package.

Properties

NameTypeAccessDescription
source_pathOptional[str]ReadHolds the original file path of the opened package, or None

Methods

SignatureDescription
__init__()Initialize an empty OPC package.
open(source: Union[str, BinaryIO])OpcPackageOpen an OPC package from a file path or stream.
create_new()OpcPackageCreate a new empty OPC package.
save(destination: Union[str, BinaryIO])Save the OPC package to a file path or stream.
get_part(part_name: str)Optional[bytes]Get the content of a part by name.
set_part(part_name: str, content: Union[bytes, str])Set or update the content of a part.
has_part(part_name: str)boolCheck if a part exists in the package.
delete_part(part_name: str)boolDelete a part from the package.
get_part_names()list[str]Get a list of all part names in the package.
close()Close the package and release resources.