[Proposal] Faster way to print | Silent Print | Webapp Hardware Bridge

Oh thank you very much! I was implementing QZ Tray for Odoo a few years ago, but I had completely forgotten the name and was painfully itching my head on how to find it again. Can you believe it? :slight_smile: Thanks!

@roquegv What advantages do you see in hardware bridge over QZ Tray?

On the top of my head, I might recall:

  • QZ Tray has no label based printer routing, but rather extension based (is that actually true?)
  • The QZ Tray license, seems hardware bridge is less restrictive?

I just looked at the QZ Tray. It looks nice. It could be enough for your requirements.

It seems to be limited to thermal printers. This could not be a problem. However, if the requirement is to use another kind of printer (eg a laser printer), QZ might not work. So, the main advantage I see of the hardware bridge over QZ is that it could handle any kind of printer.

Both support reading/writing serial ports.

  • QZ Tray has no label based printer routing, but rather extension based (is that actually true?)

Not sure about that.

  • The QZ Tray license, seems hardware bridge is less restrictive?

Yes. MIT license (hardware bridge) is less restrictive than LGPL (QZ)

1 Like

Oh, thank you!

Well, I also checked again more thoroughly and it seems to have pixel printing support indeed: https://qz.io/wiki/2.0-pixel-printing.

It looks like the routing has to be done by the js client:

var config = qz.configs.create("Printer Name");
var data = [{ 
      type: 'pdf', 
      data: 'assets/pdf_sample.pdf' 
}];
qz.print(config, data).catch(function(e) { console.error(e); });

Anyone interested in packaging qz tray for the only true (opinionated speach!) package manager: nix? https://nixos.org

Ah, many thanks for this. I spent ages looking for it. I have installed it now so will see if I can get anything working…

AGAIN…thank you!

You are welcome! :slight_smile:

Finally, some news.

I created an frappe app for this, so you can install it in your site.

Please check it out at: GitHub - roquegv/Silent-Print-ERPNext: Frappe App that allows silent print for any doctype on ERPNext or any Frappe app

Still in beta. When ready, I will go to the process of publish it in Frappe Cloud’s Marketplace.

Let me know what you think :raised_hands:

6 Likes

Great addition to the frappeverse :partying_face:
We use Firefox’s silent_print feature but we may try this also.

I don’t get how WHB communicate with Frappe? Do we enter the server IP in the WHB ?

The WHB need to be installed into the computer that is connected to the printer(s). No need to configure anything in WHB apart from the “Print Type” section (see more on the repository’s README), so, you could leave the IPs and ports as they come by default.

The communication is via web socket on localhost. So, when you send the print order to the WHB (that acts as the web socket server), it is assumed that the computer from which the order was sent is connected to the printer and therefore the WHB knows which printer to use.

I works well on a scenario that all the printers are connected to the same computer. But I’m working now on way to allows printing from any device, even if it is not connected to any printer (not even in the same LAN)

Does it answer your question?

How Frappe (which is in the cloud) know where to sent the data? We only entered the 127.0.0.1 in the WHB side. And we didn’t enter any IP in the Frappe side also.

UPDATE:
I see this code in the examples.

url: "ws://127.0.0.1:12212/printer"

So ERPNext sends to localhost which WHB listens. It’s ok now. Still interesting approach. We are fighting for moving to cloud for decades and then we struggle to communicate with serial ports.

Yes, it is so. It works on localhost.

You can look at Silent-Print-ERPNext/silent_print.js at master · roquegv/Silent-Print-ERPNext · GitHub for an example on how it is used on POS.

Hope it helps

1 Like

How do you plan to do that?

@roquegv does the app work on v12?

In a different project I implemented it using the realtime feature: What is Frappe Framework?. So, whenever a print order is send from one devise, it is send as a realtime message first, to the computer that has printer connection. This is a specific scenario though and need to be generalized. That’s what I’m working on.

1 Like

I’ve only tested in v13. It probably won’t work because the POS is completely different.

But it works for any other document in desk. See more at: GitHub - roquegv/Silent-Print-ERPNext: Frappe App that allows silent print for any doctype on ERPNext or any Frappe app

1 Like

How can I print the new draft invoices from pos awesome without accessing the invoices?

Sorry @Mohamed_Almagory but this feature is not working for the POS Awesome app yet. But the plan is to integrate it too.

Some news,

I added the feature to print remotely from any device. More info at: GitHub - roquegv/Silent-Print-ERPNext: Frappe App that allows silent print for any doctype on ERPNext or any Frappe app

Will be good to read your comments.

1 Like