Method Layout
- Namespace
- DocWright
- Assembly
- DocWright.dll
Layout(WordDocument, ConvertOptions?)
Resolves and lays out a document exactly as Convert(WordDocument, Stream, ConvertOptions?) would, without rendering it.
public LaidOutConversion Layout(WordDocument document, ConvertOptions? options = null)
Parameters
documentWordDocumentThe document to lay out.
optionsConvertOptionsThe conversion options, or null for defaults.
Returns
- LaidOutConversion
The laid-out document, the font engine it was measured with, and the render options a conversion would pass its renderer.
Remarks
This is the entry point for an ILayoutRenderer written outside
this library. It runs the same pipeline Convert and ConvertToImages run
up to the point where rendering begins — option validation, the font-engine cache,
the fonts the document embeds, resolution, the font preflight, layout, and the
ResourceLimits those stages enforce — and the same diagnostics and
StrictMode refusals come out of it.
Draw the result with Fonts, never with an engine
of your own: layout measured every line with that engine, embedded fonts included, and
ResolveRun(GlyphRun, IConversionDiagnostics?) gives the face the built-in renderers draw a run
with. Handing Document, Fonts
and RenderOptions to PdfLayoutRenderer produces
the bytes Convert produces.
Logical structure follows TaggedPdf, as it does for
Convert. ConvertToImages always lays out without it, so the layout is the
one ConvertToImages draws when TaggedPdf is false, which is the
default.
The whole document is laid out; Pages reaches the renderer through RenderOptions, as it does in a conversion. Safe to call concurrently, like every conversion method.
Exceptions
- ArgumentNullException
documentis null.