HTML

The :html formatter renders HTML content on DOCX, ODT and PDF documents.

Unsupported tags, attributes and styles are skipped and not rendered.

Supported tags

  • <br>

  • <b>

  • <strong>

  • <i>

  • <em>

  • <u>

  • <s>

  • <p>

  • <a href="URL">

  • <ol>

  • <ul>

  • <li>

  • <del>

  • <img>

Anchor tag <a href="URL">

Font family/font size

If a font family or/and a font size is applied on a HTML marker, the content is rendered with the same font properties. Text alignment on the rendered HTML content is not kept.

Inside paragraph/mixed with other content

When the HTML marker is placed inside a paragraph and mixed with other content, the content is pushed in a new paragraph above or below the rendered HTML, refer to Example 2.

HTML lists

To render HTML lists, such as <ol>/<li> or <ul>/<li>, create a bullet list on the template then delete it, then the generated report will render the list.

Image tag <img>

The image source attribute can be an URL or Data-URL, such as <img src="https://carbone.io/img/favicon.png"/> or <img src="data:image/jpeg;base64,/9j...."/>

The image size is rendered based on width and height attributes provided by the HTML tag, such as <img src="" width="300" height="100"/>.

  • values must be pixels

  • if width or height attributes are missing, the size of 5 cm (1.96 in) is applied by default while retaining the image aspect ratio

Last updated