Print labels from MQTT input using predefined pdfmake templates.
Before running, provide a config.json
file in the root directory.
credentials
: MQTT connection settings as taken by the mqtt library on connect.base_topic
: The root topic to listen on. Will try to match any subtopic against the given templates.printer
: The name of the printer to use as given bylpstat -p
..printer_options
: Any additional printer options to pass with the print job. For supported values runlpoptions -p Printer_Name -l
Put your templates in the /templates
subfolder. Each template consists of one javascript file, that should expose a async function render(input)
that returns a pdfmake document definition.
For an examples see munichmakerlab/mqtt_labelmaker_templates.
npm install
node start