Table of Contents

Method SaveAsync

Namespace
DocWright
Assembly
DocWright.dll

SaveAsync(WordDocument, Stream, string, SaveOptions?, CancellationToken)

Saves a document asynchronously. The write itself is synchronous — writers stream straight to the output — so this buffers nothing and exists for call-site symmetry.

public Task SaveAsync(WordDocument document, Stream output, string extension = ".docx", SaveOptions? options = null, CancellationToken cancellationToken = default)

Parameters

document WordDocument

The document to save.

output Stream

The writable stream that receives the package bytes.

extension string

The target extension, for example ".docx".

options SaveOptions

The save options, or null for defaults.

cancellationToken CancellationToken

A token that cancels the save.

Returns

Task

A task that completes when the document has been written.