Design

In-template options

Set render options directly inside a template with {o.…} tags

Overview

Template options let you set certain render options from inside the template itself, instead of (or in addition to) passing them in every API call. They are written as a special tag:

{o.optionName=value}

Place the tag anywhere in the template. It is processed during rendering and removed from the final document. This is convenient when an option is specific to a template, so you do not have to remember to send it on every render request.

The syntax always requires a value: {o.key=value}. Boolean options take true or false. A template option takes precedence over the same option set in the API render call.

Available options

Option Example Description
converter {o.converter=L} Force the conversion engine: L = LibreOffice, O = OnlyOffice, C = Chromium. Only L, O and C are accepted. See converters.
lang {o.lang=fr} Set the locale language used by Carbone (lower-cased automatically). See translations & i18n.
timezone {o.timezone=Europe/Paris} Set the timezone used to format dates. See timezones.
hardRefresh {o.hardRefresh=true} Force LibreOffice to render and refresh the whole document at the end of the process, for example to recompute fields, spreadsheet formulas, or a table of contents.
exportFormattedValuesAsText {o.exportFormattedValuesAsText=true} In XLSX output, export formatted values (produced by formatN) as text instead of a native spreadsheet number format. See number formatters.
styleSource {o.styleSource=templateId} Apply the style of another DOCX or ODT template. Mainly used to style Markdown templates, see Markdown templates.
useHighPrecisionArithmetic {o.useHighPrecisionArithmetic=true} Use high-precision arithmetic for computations in the template.
preReleaseFeatureIn {o.preReleaseFeatureIn=5004002} Enable a pre-release feature for a specific Carbone version (used to opt into a fix or feature before it becomes the default).

Example

A Word template that should always be rendered with the OnlyOffice converter, in French, and hard-refreshed so its table of contents is rebuilt:

{o.converter=O}
{o.lang=fr}
{o.hardRefresh=true}