OpcPackage
Overview
OpcPackage is a class in Aspose.Slides for Python.
Manages an Open Packaging Conventions (OPC) package.
Properties
| Name | Type | Access | Description |
|---|---|---|---|
source_path | Optional[str] | Read | Holds the original file path of the opened package, or None |
Methods
| Signature | Description |
|---|---|
__init__() | Initialize an empty OPC package. |
open(source: Union[str, BinaryIO]) → OpcPackage | Open an OPC package from a file path or stream. |
create_new() → OpcPackage | Create 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) → bool | Check if a part exists in the package. |
delete_part(part_name: str) → bool | Delete 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. |