Text sections are the backbone of most thermal printer receipts and tickets. They cover everything from bold store headings and item tables to simple separator lines, and aDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/luis3132/tauri-plugin-thermal-printer/llms.txt
Use this file to discover all available pages before exploring further.
GlobalStyles section lets you set formatting defaults that cascade across all subsequent text output without repeating yourself on every line.
Title
TheTitle section prints a line of text with forced double size and center alignment, making it ideal for store names, receipt headers, or any top-level heading. You may pass optional styles to override color inversion, font, or other properties, but the double size and center alignment are always applied on top.
The heading text to print.
Optional style overrides applied on top of the forced defaults. See GlobalStyles for all fields.
Double size and center alignment are always enforced for
Title sections regardless of what you pass in styles. To print a heading without these forced styles, use a Text section with explicit size and align values instead.Subtitle
TheSubtitle section prints a line with forced bold and increased height (taller characters without doubling the width). Use it for secondary headings, branch names, receipt sub-headers, or any text that needs more visual weight than plain Text but less dominance than Title.
The subtitle text to print.
Optional style overrides. Bold and height size are always enforced on top.
Text
TheText section prints a single line (or wrapped block) of content using the current global styles as defaults. Any fields you include in styles override the corresponding global default — you only need to specify what you want to change. Omitting styles entirely inherits whatever GlobalStyles was last set.
The text content to print.
Partial or full style object. Only the fields you set override the current global defaults.
Table
TheTable section renders a multi-column grid. Columns can have custom widths and each cell supports the same text + styles structure as a Text section. Tables are perfect for item lists, price breakdowns, and any aligned columnar data on a receipt.
Number of columns in the table (e.g.
3).Array of rows. Each row is an array of
{ text, styles? } cell objects. Every row must contain exactly columns cells.Array of character widths for each column. When provided:
- Length must equal
columns. - The sum must equal the paper’s chars-per-line (e.g. 48 for
Mm80, 32 forMm58). - If omitted, columns are distributed evenly across the paper width.
Optional array of header cells. Must contain exactly
columns elements if provided.When
true, long cell text is truncated to fit its column width. When false, text wraps onto the next line. The table() builder defaults to true.Paper width reference
| Paper size | Chars per line | Notes |
|---|---|---|
Mm40 | 21 | Handheld ticket printers |
Mm44 | 24 | Compact POS |
Mm58 | 32 | Common portable format |
Mm72 | 42 | Mid-range |
Mm80 | 48 | Standard large format (default) |
Mm104 | 62 | Wide format |
Line
TheLine section fills the entire paper width with a repeated single character, creating a horizontal separator. It is one of the most commonly used sections on receipts — separating the header from the item list, and the total from the payment section.
The single character to repeat across the full paper width. Common choices:
"-", "=", "_", "*", "~".GlobalStyles
TheGlobalStyles section changes the default styles for all subsequent text sections (Title, Subtitle, Text, Table, Line) until another GlobalStyles section overrides them again. All fields are optional — you only need to specify what you want to change.
Enable bold text. Default:
false.Enable underlined text. Default:
false.Text alignment. Default:
"left".Enable italic text. Default:
false.Invert colors (white text on black background). Default:
false.Select printer font. Font A is the widest and most readable; Font B is narrower. Default:
"A".Rotate text 90 degrees clockwise. Default:
false.Print text upside-down. Default:
false.Character size.
"height" doubles height only, "width" doubles width only, "double" doubles both. Default: "normal".GlobalStyles affects all subsequent sections in the sections array. It does not retroactively change sections that have already been processed. Insert a second GlobalStyles section to revert any changes for later sections.