Top Method Summary
Options Name Purpose
Append (character) Appends the given value to the output buffer
AppendLongchar (longchar) Appends the given longchar value to the output
CHARACTER BlockStyleAttribute (TextDocument) Returns the style attribute that carries the alignment and the indentation of the block that is being written
CloseAllLists () Closes every open list element
CloseCell () Closes the table cell that is open
CloseList () Closes the innermost open list element
CloseRow () Closes the table row that is open, and the cell inside it
CloseTable () Closes the table that is open, and the row and the cell inside it
CHARACTER ColorValue (integer) Returns the CSS notation of the given RGB value
LONGCHAR EscapeHtml (longchar) Escapes the given value for use in HTML text or in an attribute value
Flush () Flushes the output buffer into the longchar result
LOGICAL HasRunStyle (TextRunFormat) Returns if the given run carries a font property that has to be written as an inline style
LOGICAL IsOpenedFor (logical, integer, ListNumberingEnum) Returns if the list element the ttList buffer is positioned on was opened with the attributes the given item needs
Consultingwerk.Util.DocumentConverter.ListNumberingEnum NumberingOrDecimal (ListNumberingEnum) Returns the given numbering type, or Decimal for the unknown value and None
OpenList (logical, integer, ListNumberingEnum) Opens a new list element one level deeper
INTEGER PutAscii (memptr, integer, character) Writes the given ASCII value into the target
ResetState () Resets the writer state so that an instance could be reused
SyncTable (TextDocument) Opens and closes the table elements the membership of the block that is about to be written asks for
CHARACTER TypeAttributeOf (ListNumberingEnum) Returns the value of the type attribute of an ordered list for the given numbering type
CHARACTER UnderlineElement (UnderlineStyleEnum) Returns the opening u element of an underline style
LONGCHAR Write (TextDocument) Writes the given TextDocument out as an HTML5 fragment
WriteBlock (TextDocument) Writes one block of the document
WriteImageRun (TextDocument) Writes an embedded image as a data URI
WriteListItem (TextDocument) Writes one list item, opening and closing the list elements the nesting level of the item asks for
WriteRuns (TextDocument) Writes the runs of the block the given document is positioned on
WriteRunStyle (TextRunFormat) Writes the opening span element with the font properties of a run
WriteTextRun (TextDocument) Writes a single text run with the elements of its formatting

Top Constructor Summary
Options Name Purpose
HtmlWriter () Creates a new HtmlWriter instance


Method Detail
Top

Append (character)

Purpose: Appends the given value to the output buffer
Notes: Flushes the buffer into the result first when the value would
take it past the CHARACTER limit

Parameters:
pcValue CHARACTER
The value to append
Top

AppendLongchar (longchar)

Purpose: Appends the given longchar value to the output
Notes: The text of a run and the data URI of an image can be longer
than the CHARACTER limit on their own, and the text can carry
characters the session code page does not know, so the buffer
is flushed and the value is appended to the LONGCHAR result

Parameters:
plcValue LONGCHAR
The value to append
Top

CHARACTER BlockStyleAttribute (TextDocument)

Purpose: Returns the style attribute that carries the alignment and the
indentation of the block that is being written
Notes: Both sit on the element of the block rather than on the td of
a cell, because the blocks of a cell each carry their own and
a cell may hold more than one of them. An empty value is
returned for a block that carries neither - the writer emits
only what the model carries, so a document that never
mentioned alignment comes out the way it did before the model
knew the property (SCL-5855), and the same holds for the
indentation (SCL-5856).
The declarations are written in a fixed order, the alignment
before the indentation, because the writer has to yield the
same bytes for the same model every time.
The indentation is written as a left margin rather than as
nested blockquote elements. The model holds one concept for a
quoted and an indented passage (see TextDocument), so the
writer has to pick one canonical construct for it, and a
declaration on the block itself composes with a table cell, a
list item and a code block with no nesting to keep track of -
which is the same reason the model holds a table flat. The
visible cost is that a blockquote that was read comes back as
an indented paragraph.

Parameters:
poDocument Consultingwerk.Util.DocumentConverter.TextDocument
The TextDocument positioned on the block to write
Returns CHARACTER
The character with the style attribute, including its leading blank
Top

CloseAllLists ()

Purpose: Closes every open list element
Notes: Called before a block that is not a list item and at the end
of the document

Top

CloseCell ()

Purpose: Closes the table cell that is open
Notes:

Top

CloseList ()

Purpose: Closes the innermost open list element
Notes: The list item of the parent level stays open - the list that
is closed here was written inside it

Top

CloseRow ()

Purpose: Closes the table row that is open, and the cell inside it
Notes:

Top

CloseTable ()

Purpose: Closes the table that is open, and the row and the cell inside it
Notes: Called before a block that belongs to another table or to none
and at the end of the document

Top

CHARACTER ColorValue (integer)

Purpose: Returns the CSS notation of the given RGB value
Notes: Always the six digit hexadecimal notation in lower case, so
that the same color always yields the same declaration

Parameters:
piRgb INTEGER
The RGB value
Returns CHARACTER
The character with the color value
Top

LONGCHAR EscapeHtml (longchar)

Purpose: Escapes the given value for use in HTML text or in an
attribute value
Notes: The ampersand, the two angle brackets and the double quote are
written as their entity; every other character is written as
itself, so that the result carries the UTF-8 encoding of the
value rather than a numeric entity per character.
The escaping works on the UTF-8 bytes: the four characters
that are escaped are ASCII, and an ASCII byte never occurs
inside a multi byte UTF-8 sequence, so scanning bytes cannot
cut a character in half. An ABL string operation could not do
this at all - it would collate the value through -cpinternal.

Parameters:
plcValue LONGCHAR
The value to escape
Returns LONGCHAR
The longchar with the escaped value, fixed to UTF-8
Top

Flush ()

Purpose: Flushes the output buffer into the longchar result
Notes:

Top

LOGICAL HasRunStyle (TextRunFormat)

Purpose: Returns if the given run carries a font property that has to
be written as an inline style
Notes:

Parameters:
poFormat Consultingwerk.Util.DocumentConverter.TextRunFormat
The character formatting of the run
Returns LOGICAL
TRUE when the run needs a span element
Top

LOGICAL IsOpenedFor (logical, integer, ListNumberingEnum)

Purpose: Returns if the list element the ttList buffer is positioned on
was opened with the attributes the given item needs
Notes: SCL-5858

Parameters:
plNumbered LOGICAL
TRUE for a numbered item
piStart INTEGER
The number of the item
poNumbering Consultingwerk.Util.DocumentConverter.ListNumberingEnum
The numbering type of the item
Returns LOGICAL
TRUE when the element fits the item
Top

Consultingwerk.Util.DocumentConverter.ListNumberingEnum NumberingOrDecimal (ListNumberingEnum)

Purpose: Returns the given numbering type, or Decimal for the unknown
value and None
Notes: SCL-5858

Parameters:
poNumbering Consultingwerk.Util.DocumentConverter.ListNumberingEnum
The numbering type
Returns Consultingwerk.Util.DocumentConverter.ListNumberingEnum
The ListNumberingEnum member
Top

OpenList (logical, integer, ListNumberingEnum)

Purpose: Opens a new list element one level deeper
Notes: An ordered list carries the start and the type attribute only
where they differ from what HTML assumes without them - a start
of 1 and decimal numbers - so that a document whose lists all
count 1. 2. 3. keeps the bytes it had before the model held the
numbers (SCL-5858). The attributes rather than a
list-style-type declaration are the canonical construct: both
editors read them, and they are written in this fixed order.
The HtmlReader reads the declaration as well.

Parameters:
plNumbered LOGICAL
TRUE for an ordered list, FALSE for an unordered one
piStart INTEGER
The number of the first item of an ordered list
poNumbering Consultingwerk.Util.DocumentConverter.ListNumberingEnum
The numbering type of an ordered list
Top

INTEGER PutAscii (memptr, integer, character)

Purpose: Writes the given ASCII value into the target
Notes: Used for the entities only, which are ASCII by construction

Parameters:
pmTarget MEMPTR
The memptr to write to
piPos INTEGER
The position to write at
pcAscii CHARACTER
The ASCII value to write
Returns INTEGER
The position behind what was written
Top

ResetState ()

Purpose: Resets the writer state so that an instance could be reused
Notes:

Top

SyncTable (TextDocument)

Purpose: Opens and closes the table elements the membership of the
block that is about to be written asks for
Notes: The whole table support of this writer. The model holds a
table as membership on the blocks of its cells, so the
nesting of table, tr and td follows from comparing the
membership of this block against the one of the block that
was written last - no lookahead and no second cursor.
A list is closed when a cell is left: a list belongs to the
cell that holds it, and its closing tags have to be written
before the cell is closed.

Parameters:
poDocument Consultingwerk.Util.DocumentConverter.TextDocument
The TextDocument positioned on the block to write
Top

CHARACTER TypeAttributeOf (ListNumberingEnum)

Purpose: Returns the value of the type attribute of an ordered list for
the given numbering type
Notes: The value is case sensitive in HTML - a is a lower case letter,
A an upper case one - while an ABL comparison is not, so two
values of this method are never compared with each other; see
IsOpenedFor. The unknown value and None are decimal numbers
(SCL-5858).

Parameters:
poNumbering Consultingwerk.Util.DocumentConverter.ListNumberingEnum
The numbering type
Returns CHARACTER
The character with the value, 1 for decimal numbers
Top

CHARACTER UnderlineElement (UnderlineStyleEnum)

Purpose: Returns the opening u element of an underline style
Notes: The bare u element for Single, so that a plain underline
writes what it always wrote, and the text-decoration-style
declaration on the u element for the other four - the u
element draws the line, the declaration styles it, and the
HtmlReader maps that pair back to the style (SCL-5859)

Parameters:
poStyle Consultingwerk.Util.DocumentConverter.UnderlineStyleEnum
The underline style of the run
Returns CHARACTER
The character with the opening u element
Top

LONGCHAR Write (TextDocument)

Purpose: Writes the given TextDocument out as an HTML5 fragment
Notes: An empty document yields an empty value - that is the value
the Kendo Editor uses for an empty document - and an empty
paragraph yields an empty p element

Parameters:
poDocument Consultingwerk.Util.DocumentConverter.TextDocument
The TextDocument to write out
Returns LONGCHAR
The longchar with the HTML fragment
Top

WriteBlock (TextDocument)

Purpose: Writes one block of the document
Notes:

Parameters:
poDocument Consultingwerk.Util.DocumentConverter.TextDocument
The TextDocument positioned on the block to write
Top

WriteImageRun (TextDocument)

Purpose: Writes an embedded image as a data URI
Notes: The alt attribute is always written, so that reading the
fragment back and writing it out again yields the same bytes

Parameters:
poDocument Consultingwerk.Util.DocumentConverter.TextDocument
The TextDocument positioned on the image run to write
Top

WriteListItem (TextDocument)

Purpose: Writes one list item, opening and closing the list elements
the nesting level of the item asks for
Notes: A nested list is written inside the list item of its parent
level, which is where HTML expects it

Parameters:
poDocument Consultingwerk.Util.DocumentConverter.TextDocument
The TextDocument positioned on the list item to write
Top

WriteRuns (TextDocument)

Purpose: Writes the runs of the block the given document is positioned on
Notes:

Parameters:
poDocument Consultingwerk.Util.DocumentConverter.TextDocument
The TextDocument positioned on the block to write
Top

WriteRunStyle (TextRunFormat)

Purpose: Writes the opening span element with the font properties of a run
Notes: The declarations are written in a fixed order and only for the
properties that are set, which is what keeps the output
deterministic. A font name is not quoted - an unquoted CSS
font family may carry blanks - and it is appended as a
LONGCHAR, because a font name in a script the session code
page does not know would not survive a CHARACTER.

Parameters:
poFormat Consultingwerk.Util.DocumentConverter.TextRunFormat
The character formatting of the run
Top

WriteTextRun (TextDocument)

Purpose: Writes a single text run with the elements of its formatting
Notes:

Parameters:
poDocument Consultingwerk.Util.DocumentConverter.TextDocument
The TextDocument positioned on the run to write


Constructor Detail
Top

HtmlWriter ()

Purpose: Creates a new HtmlWriter instance
Notes: The result is fixed to UTF-8 here rather than in Write,
because FIX-CODEPAGE can only be applied to a LONGCHAR that
has no value yet



©2006-2026 Consultingwerk Ltd.         info@consultingwerk.de         http://www.consultingwerk.de       19.09.2026 10:19:18