Printing from NodeRed

Hi all, I'm trying to print a PDF generated with the pdfmake node to both a network printer and a printer shared via windows 10.

I've managed to print to the network printer (it's a Xerox, that has IPP enabled) via the IPP node, but I'm struggling to understand how to manage a print on a usb printer shared from a computer.

What I'm trying to do it's just a webpage ([noderedlink]/hello-world) that has a button that the user can click: once the button is clicked I read from a MSSQL database, then create a QR code, then a PDF and this pdf has to be printed to one or the other printer.

Has anyone here ever managed to print on a windows-shared printer? Do you have an idea on how to do it?

My nodered is installed via docker on a linux server.

One obvious way would be to do it via a browser but of course that requires user intervention to pull up the PDF then print it.

You don't say what platform you are running Node-RED on so it is a bit hard to give specific advise. Windows printers can, of course, be shared using the Windows Print Service and you can install drivers for other platforms assuming the manufacturer of the printer has provided them. My Canon printer certainly does. I think that SAMBA should be able to enable Windows Printing from Linux devices.

Looks like there isn't a current implementation of IPP over USB for Windows 10. However, it is added to the universal print driver for Windows 11.

The alternative would be to move the printer to a Linux device (a Pi for example would do). Then you can share using IPP

There is an NPM package that can print from node js.

You could try importing this lib in a function node & printing.

The "browser" solution is the one that I'm actually implementing, but it's far from great because it requires the user to choose the right file to print, and this is exactly what I'd like to avoid.

I'm running nodered on a linux mint virtual computer, that runs on ESXi, so I really have no way of connecting the printer locally.

I have several notebooks on mobile desks (aka desks with wheels) that have a local printer connected via USB: they shall access my website and, by knowing their IP, I'd like to print "on their" local (windows shared) printer. I've tried with "PaperCut" mobility print and this works great to share the printer for mobile phones, but with IPP I wasn't able to make it run.

The raspberry pi share could be a solution, though... I might look into it if I cannot find any other alternative.

Thank you, in the mean time!

Thank you for the tip, but as said I'm running on a linux server: as far as I've read this is for windows only :frowning:

Sorry. I missed that due to you saying you wanted to print to windows shared printer.

however, you could knock up a nodejs application that runs on a windows server/pc that provides a service for you to print from linux via an endpoint...

(or install node-red on a windows box primarily for printing)

Looks like Steve's suggestion may be a result. Run Node-RED on those laptops with the listed package and you should be good to go :grinning:

This looks cool, the only issue being that I (probably?) need to install manually node.js on every computer, put the files in place and then set it to start automatically at every boot. It could work, but it seems too complex for "deployment" with my actual knowledge.

The solution that I'm exploring right now is using qz-tray (official website) and it seems to work correctly. I obviously have to install this program on every computer, but that's it.

I'm not completely satisfied with this solution, but I guess that there are too many types of printers, drivers and protocols to be able to avoid something like QZ. I'm quite surprised that there aren't many discussions on how to print from nodered, I thought that I was missing something veeeery obvious ahah

If I get it to work correctly, I might post here some code just for those who will search for it in the future :smiley:

Printing? How quaint and last-century! :grinning:

Hahahah indeed! If I were you, I’d say the same exact thing.

The problem here it’s just that paper is way cheaper than a little device with a screen and an RFID tag!

This project could be useful to evaluate the costs of this whole printing madness, though… and maybe change how we do it! :smiley:

Well I work for an organisation that was spending £1m per year on printing before COVID! So I certainly know the arguments. One of the outcomes of COVID is a far more distributed workforce and smaller offices (something we had been trying to achieve for years). In turn, this has helped us push to reduce the number of printers.

Really all comes down to what the output is being used for doesn't it. I'd say that these days there are almost always alternatives that are cost effective when taking total cost of ownership into consideration. But without knowing more about your specific needs, it isn't possible to make any suggestions even if you wanted me too :grinning: