OpcPackage
Overview
OpcPackage is a class in Aspose.Slides FOSS for .NET.
Manages an Open Packaging Conventions (OPC) package. An OPC package is a ZIP archive containing parts (files) organized according to Office Open XML conventions. Supports loading/saving from file paths or streams and preserves unknown parts for round-trip fidelity.
This class provides 9 methods for working with OpcPackage objects in .NET programs.
Available methods include: Close, CreateNew, DeletePart, GetPart, GetPartNames, HasPart, Open, Save, SetPart.
All exported members are accessible to any .NET application after installing the Aspose.Slides FOSS for .NET package.
Properties: SourcePath.
Description
OpcPackage is a class in the Aspose.Slides FOSS library for .NET that exposes 12 methods and 1 property for programmatic use.
The class also provides the SourcePath property (gets the source path).
Properties
| Name | Type | Access | Description |
|---|---|---|---|
SourcePath | string? | Read | Gets the source path. |
Methods
| Signature | Description |
|---|---|
Open(path: string) | If the file does not exist. |
Open(stream: Stream) | A loaded instance. |
CreateNew() | A new empty instance. |
Save(path: string) | Destination file path. |
Save(stream: Stream) | Destination writable stream. |
GetPart(partName: string) | Part content as a byte array, or null if the part does not exist. |
SetPart(partName: string, content: byte[]) | Part content as bytes. |
SetPart(partName: string, content: string) | Part content as a string. |
HasPart(partName: string) | true if the part exists; otherwise, false. |
DeletePart(partName: string) | true if the part was deleted; false if it did not exist. |
GetPartNames() | A list of part paths. |
Close() | Closes the package and releases resources. Clears all in-memory part data. The package should not be used after closing. |