CFBWriter
Overview
CFBWriter is a stateless utility class that serializes a CFBDocument into the Compound File Binary on-disk format. It exposes two class methods — to_bytes for in-memory serialization and write_file for direct disk output — and is never instantiated directly.
Use CFBWriter as the final step after constructing or modifying a CFBDocument with CFBStorage and CFBStream objects.
from aspose.email_foss.cfb import CFBDocument, CFBWriter
doc = CFBDocument.from_file("input.cfb")
CFBWriter.write_file(doc, "output.cfb")
data = CFBWriter.to_bytes(doc)Class Methods
| Method | Returns | Description |
|---|---|---|
to_bytes(document) | bytes | Serializes the given CFBDocument and returns the result as a bytes object. |
write_file(document, path) | None | Serializes the given CFBDocument and writes the output to the file at path. |