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.

Properties

NameTypeAccessDescription
SourcePathstring?ReadGets or sets the original file path of the package; may be null

Methods

SignatureDescription
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.

See Also