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
documentWordDocumentThe document to save.
outputStreamThe writable stream that receives the package bytes.
extensionstringThe target extension, for example ".docx".
optionsSaveOptionsThe save options, or null for defaults.
cancellationTokenCancellationTokenA token that cancels the save.
Returns
- Task
A task that completes when the document has been written.