I stumbled on the “Network Printer / Print Server” functionality in ERPNext accidentally. This uses CUPS, which is an Apple open-source project (IPP) that comes installed with every Mac. So, I assumed, that after setting up a Network Printer, I could “natively” print on a printer without the PDF preview and printer selection that torments users of web apps.
I tried setting this up on frappe.cloud but the setup requirements were not met on the bench. After contacting frappe.cloud support, I got the following response by support:
Pycups will now be installed on all benches on Frappe Cloud. We’ve updated your existing benches, so no action is needed from your end.
Frappe.cloud support is awesome!
After opening port 631 on our firewall, I was able to discover my network printer and I saved it.
But now comes the question: how do I actually print on my Network Printer from within ERPNext / Frappe? I was assuming that there is a “Network Print” button or something of that sort in the print formats.
Anyone used this before who can shed some light, and so we can improve the docs here?
Thanks,
Dom
PS: exposing your CUPS print server on port 631 for the whole world is not a good idea. Currently, there is no way to password-authenticate, so you would have to set up your firewall to only let through a request from your frappe server. You can also do this on Frappe cloud by finding out what IP address is behind your domain name example.frappe.cloud (however any site running on that server at Frappe could then access your printers).
I was looking for this too. I don’t think this is possible through the UI.
Printing to a network printer/print server seems to be possible via API though. Through the API endpoint /api/method/frappe.utils.print_format.print_by_server.
Three parameters are needed: doctype, name and printer_setting (which is the name given to your network server when adding it to ERPNext).
@daanl I’m rying to get Network Printing working, where did you find the API info and requirements/syntax? I’ve been searching it and not been able to find it.
Can you tell me how I can call the API via a Client Script, I’m looking through the docs but can’t find how to set this up. Attempts so far generate lots of errors when the DocType loads.