A document is a tree of elements: Writer.Sections contain blocks (paragraphs and tables), and paragraphs contain inlines (text runs, fields, hyperlinks, and so on). Collections create their elements with Add... methods; every method takes an optional options object whose properties are applied to the new element, for example AddRun({ Text : 'Total' }).
Writer is a thin layer over the GemBox.Document library, so the public properties and methods of the underlying objects are also available even when this reference does not list them. Values are converted as follows:
Enumeration values are strings, such as 'Center'.
Colors are strings in #RRGGBB form. Options objects do not apply colors; set color properties after the element is added, for example run.CharacterFormat.FontColor = '#1F4E79'.
When a method has several overloads, the overload with the same number of arguments is called.
Use Writer.LoadText with HTML for documents with simple layout; build the element tree when you need tables, headers, footers, fields, or exact formatting.
varwriter=newWriter();varparagraph=writer.Sections.Add().Blocks.AddParagraph();varstatus=paragraph.Inlines.AddRun({Text:'Approved',CharacterFormat:{Bold:true,Size:14}});status.CharacterFormat.FontColor='#2E7D32';paragraph.Inlines.AddSpecialCharacter('LineBreak');paragraph.Inlines.AddRun({Text:'Details: '});paragraph.Inlines.AddHyperlink({Address:'https://portal.example.com/requests/'+$Xml.Evaluate('RequestId'),Text:'Open the request'});