Control sections manage the physical actions a thermal printer can perform beyond printing text and graphics. Rather than embedding raw ESC/POS commands yourself, you add declarative control sections to yourDocumentation 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.
sections array and the plugin translates each one into the appropriate binary command sequence. The four control sections — Feed, Cut, Beep, and Drawer — cover the full range of hardware operations you are likely to need in a POS or ticketing application.
Feed
TheFeed section advances the paper by a specified amount without printing any content. Use it to add blank space between sections, or to position the paper before a cut so the printed content clears the paper slot.
Three feed modes are available, corresponding to different ESC/POS commands:
The paper advance method:
"lines"—ESC d n: advance exactly N full text lines. The most common mode."dots"—ESC J n: advance N dot rows. Gives finer sub-line control."line_feed"— sends N raw LF (\n) characters. Behavior depends on the printer’s configured line spacing.
How much to advance. For
"lines" and "line_feed", this is a line count. For "dots", this is a dot-row count (0–255).A
Feed before Cut ensures the printed content is fully past the cutter blade and does not get cut through. Three lines is a common default: feed(3) followed by cut().Cut
TheCut section triggers the printer’s paper cutter. Four cut modes are provided to match the varying capabilities of different printer models. A partial cut is the safest default — it leaves a small perforation so the receipt stays attached until the customer tears it off.
The cut style:
"full"— complete cut through the paper."partial"— partial cut, leaving a small uncut strip. The standard default."partial_alt"— alternate partial cut command (for printers that respond to a different ESC/POS variant)."partial_alt2"— alternate full cut command variant.
Number of lines to advance before cutting. Adds a small margin between the last printed line and the cut point.
No automatic cut is appended. The plugin processes only the sections you explicitly include in
sections. To cut the paper at the end of a job, add a Cut section yourself — for example, cut() for a standard partial cut, or cut(CUT_MODE.FULL, 0) for a full cut with no extra feed.Beep
TheBeep section emits an acoustic signal through the printer’s built-in buzzer. Use it to alert staff when a receipt is ready, confirm a kitchen order arrival, or signal a completed transaction.
Number of beeps to emit (1–9).
Duration of each beep in milliseconds (1–255).
Not all thermal printers include a buzzer. If the printer has no buzzer hardware, the
Beep section is silently ignored — it will not cause an error.Drawer
TheDrawer section sends a pulse to a cash drawer connected to the printer’s RJ-11 drawer port. The printer acts as a relay — it provides a brief electrical pulse on the specified pin that triggers the drawer’s solenoid latch.
Drawer kick pin number. Most cash drawers use pin
2; some models use pin 5. Check your drawer’s documentation if in doubt.Pulse duration in milliseconds. Typical range: 50–500 ms. The drawer’s solenoid needs enough time to disengage the latch — 100–200 ms works for most drawers.
The cash drawer must be connected to the printer’s drawer port, not to the computer directly. The
Drawer section tells the printer to send the pulse — the printer must be powered on and connected for the drawer to open.