Class ComposedDocument
- Namespace
- DocWright.Composition
- Assembly
- DocWright.Composition.dll
A document authored from code through the fluent composition surface.
public sealed class ComposedDocument
- Inheritance
-
ComposedDocument
- Inherited Members
Remarks
A composition lowers to a WordDocument and renders through
the ordinary pipeline, so a composed document is a real Word document: it can be saved as
.docx, reopened, edited, mail-merged, compared and converted like any other.
The composer does not break pages — the layout engine does. Everything that would need to
measure against the space left on a page is refused by design; COMPAT.md lists
what maps, what approximates and what is refused.
Instances are immutable once created and safe to render from several threads.
Methods
- Create(Action<IDocumentComposer>)
Composes a document.
- Create(Action<IDocumentComposer>, CompositionOptions?)
Composes a document with explicit options.
- GenerateImages(ImageRenderOptions, ConvertOptions?)
Renders the composition to raster images, one per page.
- GeneratePdf(Stream, ConvertOptions?)
Renders the composition to PDF.
- GeneratePdf(string, ConvertOptions?)
Renders the composition to a PDF file.
- GeneratePdfBytes(ConvertOptions?)
Renders the composition to PDF bytes.
- SaveAsDocx(Stream, SaveOptions?)
Saves the composition as a Word document — the output QuestPDF-shaped libraries cannot produce, and a first-class result rather than a curiosity.
- SaveAsDocx(string, SaveOptions?)
Saves the composition as a Word document file.
- SaveAsDocxBytes(SaveOptions?)
Saves the composition as Word document bytes.
- ToWordDocument()
Lowers the composition to a mutable document.
This is the escape hatch: anything the fluent surface cannot express can be done here with the full editing API, and the result still renders through the same pipeline.