CFBDocument

Overview

CFBDocument is the in-memory, mutable representation of a Compound File Binary (CFB) document. It holds a root storage node of type CFBStorage along with version metadata and is the central object for constructing or modifying CFB structures. Once modifications are complete, the document is serialized using CFBWriter.

Key fields: root: CFBStorage, major_version: int, minor_version: int, transaction_signature_number: int.

from aspose.email_foss.cfb import CFBDocument, CFBStorage, CFBWriter

doc = CFBDocument.from_file("archive.cfb")
new_storage = CFBStorage(name="MyStorage")
doc.root.add_storage(new_storage)
CFBWriter.write_file(doc, "modified.cfb")

Class Methods

MethodReturnsDescription
from_reader(reader)CFBDocumentBuilds a CFBDocument from an open CFBReader instance.
from_file(path)CFBDocumentOpens a CFB file at path and returns a populated CFBDocument.

See Also