Is there an (easy, best, built-in) to print to a label printer from a Web App? This Web App needs to send a print job to a locally attached Dymo label printer. The user can’t install any ‘helper’ apps - it all has to run in the browser. Thanks for any pointers.
I hope not. I would hate for web apps to have direct access to local USB devices.
I don’t see a way for this to happen without some sort of driver or local configuration. Which makes sense - anyone having one of these printers directly attached to their computer should have installed a driver to operate it, right?
The only option I’ve seen is qztray, but this is a helper & doesn’t seem to be able to be used in your situation.
it seems you can send serial data with usb on a chrome browser
you will need a websdk to use this from xojo web but it seems something possible.
Write a simple desktop JSON server using the ServerSocket component listening to for example port 112233 and make it to talk with a webpage sending and receiving JSON packets to “http://localhost:112233”, if you get it, write simple app able to print a sample label and storing a setup string to be reused. When you get both, mix both in a third one, a companion printer server to your web app. Create a JSON based protocol, and when wanting to print some label, contact your server at http://localhost:112233 using a JavaScript fetch() and send your print label commands. Your clients must install and setup your printer server to be able to print those labels from those pages. Discard the samples used during the development, keep the final server.
He specifically said the client mustn’t be required to install any local software.
Oh, Web until other day should be isolated, and demanded special middlewares like what I said for the job, I guess it still. Zebra label printers uses such kind of solution as far as I know. The user must install their softwares/drivers to use their Browser Printing middleware services.
Thanks to everyone for these very thoughtful responses. I’m going to go outside this forum and do an exhaustive search, and I will return with answers and post them here for all to see.
In the NetSuite space, “Bartender Cloud” is pretty popular: BarTender Cloud | BarTender Cloud-based Labeling Solution
I don’t know much about it, but it might be worth a look.
It’s a long trip solution that uses REST API, also needing a “print server” installed on the machine used to print the labels. But instead of sending the print jobs to the machine, you send it to a “cloud service” (that you probably need to sign up) and your data will sit there waiting your local print service to contact it and find a job in the queue, download it, and print.
The advantages are that you can print something 3 miles away sending it to the web, and they support a good range of printer models; the disadvantages are needing a paid service, and a more complex setup (the cloud setup and the printer service setup), and if the internet link fails, you won’t print until your link is back.
Browser support is good but not universal:
Yes, supported by Chrome, with its commanding share of the market - aka the worst browser for user privacy. Perhaps the target audience will be guaranteed to be using a supported browser. I shy away from using web technologies that aren’t supported by Safari because of its Mac and mobile market share.
Well… Current printers don’t use RS232 anymore.
Label printers often do – at least the thermal ones. They have modest data size/speed requirements and need to maintain backward compatibility. Even if they plug in via USB, they tend to emulate serial ports. It’s a classic case of “if it ain’t broke, don’t fix it”.
I use one as a POS printer at my girlfriends shop with a self made POS system based on an AllInOne PC running Debian and a Kivy app…as Xojo isn’t fit yet for Linux touchscreens (o;
Modern ones are networked, BT or USB. But people usually ignore the hardware details and just use the printer APIs without needing to write their own ZPL, PCL, PS, ESC/P… layers.
Both of those connections are represented as serial ports to the OS.
Not always, some models don’t expose a serial port, but ok. I’m just curious to see someone connecting a Dymo printer to a computer and from a web page auto locate its “serial” port, if someone exists, and printing a label like this:
And any chosen text on top of it.
I have no patience to even try.
We just present a page that is formatted to the label. CSS can remove the header and footer portions of the page. The user simply prints that page to the label printer. It works a charm.
Does it work without user intervention? (open a window with such engine,format things in a hidden way, select the printer, print, close the temporary window)
Does it print batches like 20 labels with one click?
I say that because those are my usual use cases and I need desktop helpers.
I’m leaning more to the ease-of-use concepts and Use Cases like Rick mentions. For my application a clinic (one of many) will determines a specimen sample needs to be collected, so they go to our (web) app, pull up the patient record, click a few boxes and select a test - then like magic they need labels to spit out of the local printer. This happens 100x a day at a clinic, and they need immediate label outputting (and reprinting if a jam happens).