Render NiimBlue label
render_labelDesign NIIMBOT labels and preview exact 1-bit printhead output before printing; returns layout warnings and a NiimBlue open link.
Instructions
Design a NIIMBOT label for NiimBlue and see exactly what the printhead burns. Returns the 1-bit PNG NiimBlue prints (threshold 140; each dot drawn zoom×zoom px), each object's rendered box, warnings that end with their fix, and a niim.blue #load= link that opens the label in NiimBlue for printing. Units are printer dots: 8 per mm at 203 dpi, 11.81 at 300 dpi; origin top-left; objects paint in array order and use NiimBlue/fabric property names. Floors at 203 dpi (×dpmm/8 at 300 dpi): text ≥16 px; weight ≥500 under 24 px; strokes ≥2 px; QR modules ≥3 px with 4 clear modules; Code 128 scaleFactor ≥2 with 10 clear modules; text and codes ≥1 mm from the edges. Colours: black, white, transparent. Only Noto Sans Variable (Latin, Cyrillic) + Material Icons survive the link. Fix every warning and render again. Final call: include_json, for the .json export. The link replaces the label open in NiimBlue after a confirm: tell the user to save it first. {key} fields fill from rows (preview: row 1; more than 1 row travels as NiimBlue's CSV, one label per row). save_as writes the args and an importable .niimblue.json to the templates folder; template starts from saved args.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| rows | No | Values for {key} fields, one object per label. The preview shows row 1. 1 row: the link carries the filled text. More: the link carries them as NiimBlue's CSV (it replaces the user's open CSV) and prints one label per row | |
| split | No | Split the label into parts (cable flags) | |
| title | No | Label name in NiimBlue's saved labels; travels only in the .json export (include_json, save_as), so after opening the link the user types it when saving | |
| mirror | No | Repeat the design into the other split part, optionally rotated | |
| objects | No | Objects in paint order: the first is the bottom layer | |
| printer | No | Printer model, e.g. D110, B1, D11_H: sets dpi, print direction and printable width | |
| save_as | No | Save these args as a template under this name: writes <name>.args.json and an importable <name>.niimblue.json | |
| tail_pos | No | Side of the cable-flag tail | |
| template | No | Saved template name (list_templates): its args are the base, the args given here override them, objects and rows replace wholesale | |
| width_mm | No | Label width as set in NiimBlue. B-series (top): runs across the head | |
| height_mm | No | Label height as set in NiimBlue. D-series (left): the tape width across the head | |
| overwrite | No | Replace an existing save_as template (default false: refuse) | |
| split_parts | No | Number of split parts | |
| include_json | No | Also return the NiimBlue .json export; set it on the final call | |
| tail_length_mm | No | Tail length in mm |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | ||
| link | Yes | Opens the label in NiimBlue (after a confirm that replaces the open label) | |
| tool | Yes | ||
| zoom | Yes | Each printer dot is zoom×zoom PNG pixels | |
| boxes | Yes | Rendered bounding boxes in dots, after auto-size | |
| label | Yes | ||
| saved | No | save_as: the template files written | |
| warnings | Yes | ||
| link_chars | Yes |