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.

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, I = Carbone ICE (DOCX to PDF only). Any other value is ignored. 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. Template only. See number formatters.
styleSource {o.styleSource=templateId} Apply the style of another DOCX or ODT template, given by its template ID or version ID. Template only. Mainly used to style Markdown templates, see Markdown templates.
useHighPrecisionArithmetic {o.useHighPrecisionArithmetic=true} Use arbitrary-precision decimal arithmetic instead of JavaScript floating-point numbers for add, sub, mul, div, formatN and formatC. Template only.
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).

styleSource, useHighPrecisionArithmetic and exportFormattedValuesAsText are marked Template only: they exist nowhere else, they cannot be sent in the render call.

Rules

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}