Package: inventree-cab-plugin
inventree-cab-pluginA label printing plugin forInvenTree, which provides support for theCab label printers.This plugin supports printing to cab printers using FTP. It was only tested on the MACH 4S model but should work on other models with similar capabilities.InstallationAdd the following line toplugins.txtfor automatic installation using theinvoke installcommand:install inventree-cab-pluginOr install manually with:pipinstallinventree-cab-pluginFor further development, can also setup an editable install (see InvenTreedocumentation).An example using the InvenTree docker (see InvenTreedocumentation):# Setup InvenTree development dockergitclonehttps://github.com/inventree/InvenTree.git&&cdInvenTree
dockercomposeruninventree-dev-serverinvokeupdate
dockercomposeruninventree-dev-serverinvokesetup-test--dev
dockercomposeup-d# Install plugin inside docker containerdockerps# Note the `NAME` or `CONTAINER ID` unique prefix for inventree-dev-server containerdockerexec-itinventree-inventree-dev-server-1/bin/sh# In shell inside dockersourcedata/env/bin/activate# Copy plugin code to data/plugins/ folder on host (same folder is already mounted inside docker)cd./data/plugins/inventree-cab-plugin
pipinstall--editable.Configuration OptionsIn InvenTree Web GUI (In docker development environment accessible onhttp://localhost:8000), go to the settings page and then to the plugin settings section.
If run InvenTree inside docker, should toggle theCheck plugins on startupsetting and restart (docker compose restart) if it was not enabled.Afterward can enable the Cab Labels plugin and access its settings.
The IP Address of the printer should be entered for the plugin to work. The other settings should be modified according to the printer settings.Printing OptionsWhen select stock items to print labels for, can select a label template.
On InvenTree administration page can upload new label template e.g., Stock Item Label (in dev. environment athttp://localhost:8000/admin/label/stockitemlabel/).Here can click onADD STOCK ITEM LABEL, give the label a name, select a file and configure the other desired parameters like the width and height, then save.An example jscript is shown below. Upload it as an html label template to inventree as described above.For other examples can refer to the Programming cab printer PDF that can be found online e.g. from cabwebsite. There is also a jscript programming manual available from cab website.The variables in{{ }}are from the django template language (see djangodocumentation).; Set [m]easurements to [m]illimeters
m m

; Create a [J]ob
J

; [S]et Label Size
; S [start detection;] displacement to the right, displacement downwards, height, height + gap, width
; S l1; 0, 0, 30, 32, 60
; using {{ height }} {{ width }} params configured when uploaded template jscript
; S l1; 0, 0, {{ height }}, {{ height|add:2}}, {{ width }}

; W:[refrence;] , x position, y position, rotation, width, height, font, size; text
W:Titlebox; 1, 1, 0, {{ width }}, 6, 3, 3;<HTML><h2>Company</h2></HTML>; Barcode
; B [name;] x, y, r, type[+options], size; content
; NOTE: IF write CODE128 will print text of barcode below, but not if write CODE128
; with code128 need to specify height, width smallest bar
B 1, 7, 0, code128, 8, 0.2; {{ qr_data }}

; W: x, y, rotation, width, height, font, size; text
W:Textbox; 1, 15, 0, {{ width }}, 12, 3, 2;<HTML><p>SN: {{ serial }}</p><p>PN: {{ part.IPN }}</p><p>{{ part.name }}</p></HTML>; Print one label
; A 1
; Preview at https://PRINTER_IP/cgi-bin/bitmap
A [preview]If use the preview commandA [preview]toggle the preview option before printing in inventree.