Method DefineStyle
- Namespace
- DocWright.Composition
- Assembly
- DocWright.Composition.dll
DefineStyle(string, string, Action<IStyleComposer>)
Defines a named style. A composition style is a Word style, so it survives SaveAsDocx(Stream, SaveOptions?) and behaves in Word exactly as it rendered in the PDF.
IDocumentComposer DefineStyle(string styleId, string name, Action<IStyleComposer> define)
Parameters
styleIdstringThe style id, for example "Heading1".
namestringThe style's display name, as Word shows it.
defineAction<IStyleComposer>Defines the style's formatting.
Returns
- IDocumentComposer
This composer, for chaining.
Exceptions
- ArgumentNullException
A required argument is null.
- ArgumentException
styleIdis empty.- InvalidOperationException
A style with that id is already defined.