Print Node Integration for Frappe Framework

Guys, I’m publishing my integration with Print Node API, to print from web directly to the printers.

It use Print Node as communication to the printer

The pros of this project:

  • Support to Label Printers
  • Support to ESC POS Printers
  • PDF Attachment Printing
  • Supports to Scales (under development)
  • Support to Render ESC POS Templates using py-xml-escpos from Frappe Print Formats
  • Support to send commands to the POS Cashier, like unlock or open the drawer
  • Configurable Actions, you dont’t need any line of code, to configure a button in your doctypes to send a document to the printer
  • Rulable action buttons, just put a depends_on rule to filter attachments or determine when the user can see the action to print

The cons:

  • Missing Documentation
  • You Need a Print Node Account
  • A work in progress
20 Likes

Hey Max,
The print node functionality looks great and would really help retail based installs.
As you contribute a lot to the frappe code base could I suggest this?
If you were to obtain a Print Node Integrator Account and rebrand it as “Max’s Super Print App” Developers such as myself could choose to sign up to M.S.P.A and pay the $5 dollars per month they would normally pay to print node to you instead. You would get a $2 per month commission. If you were to get 100 users… well you do the math. Developers could of course pay $5 per month directly to Print Node. To minimise the admin at your end I would suggest a 12 month minimum sign up. So $60 upfront for each install. Maybe allow for a 6 month trail signup initially to allow Developers time to test the system out.
This idea might not be a large or long term revenue stream but it might generate enough cash to pay you for some of your time coding frappe. Who knows it might cover your expenses to build a similar app within frappe that doesn’t require a Third Party Web Service?
Just a thought.

I would sign up for 1 x 12 month plan.

1 Like

Hi @max_morais_dmm i will love to test your app, any basic tutorial in how to install it? right now im getting this when i use bench get-app

installing printnode_integration
INFO:bench.app:installing printnode_integration
/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/pip/_vendor/requ                                       ests/packages/urllib3/util/ssl_.py:318: SNIMissingWarning: An HTTPS request has                                        been made, but the SNI (Subject Name Indication) extension to TLS is not availab                                       le on this platform. This may cause the server to present an incorrect TLS certi                                       ficate, which can cause validation failures. You can upgrade to a newer version                                        of Python to solve this. For more information, see https://urllib3.readthedocs.i                                       o/en/latest/security.html#snimissingwarning.
  SNIMissingWarning
/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/pip/_vendor/requ                                       ests/packages/urllib3/util/ssl_.py:122: InsecurePlatformWarning: A true SSLConte                                       xt object is not available. This prevents urllib3 from configuring SSL appropria                                       tely and may cause certain SSL connections to fail. You can upgrade to a newer v                                       ersion of Python to solve this. For more information, see https://urllib3.readth                                       edocs.io/en/latest/security.html#insecureplatformwarning.
  InsecurePlatformWarning
  Could not find a version that satisfies the requirement printnodeapi (from pri                                       ntnode-integration==0.0.1) (from versions: )
No matching distribution found for printnodeapi (from printnode-integration==0.0                                       .1)
/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/pip/_vendor/requ                                       ests/packages/urllib3/util/ssl_.py:122: InsecurePlatformWarning: A true SSLConte                                       xt object is not available. This prevents urllib3 from configuring SSL appropria                                       tely and may cause certain SSL connections to fail. You can upgrade to a newer v                                       ersion of Python to solve this. For more information, see https://urllib3.readth                                       edocs.io/en/latest/security.html#insecureplatformwarning.
  InsecurePlatformWarning
Traceback (most recent call last):
  File "/usr/local/bin/bench", line 11, in <module>
    load_entry_point('bench', 'console_scripts', 'bench')()
  File "/home/frappe/.bench/bench/cli.py", line 40, in cli
    bench_command()
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 716, in __ca                                       ll__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 696, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 1060, in inv                                       oke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 889, in invo                                       ke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 534, in invo                                       ke
    return callback(*args, **kwargs)
  File "/home/frappe/.bench/bench/commands/make.py", line 30, in get_app
    get_app(git_url, branch=branch)
  File "/home/frappe/.bench/bench/app.py", line 73, in get_app
    install_app(app=app_name, bench_path=bench_path, verbose=verbose)
  File "/home/frappe/.bench/bench/app.py", line 103, in install_app
    find_links=find_links))
  File "/home/frappe/.bench/bench/utils.py", line 127, in exec_cmd
    raise CommandFailedError(cmd)
bench.utils.CommandFailedError: ./env/bin/pip install -q  -e ./apps/printnode_integration

Hi @max_morais_dmm,

Nice work! But why didn’t you use google cloud print? It is free!
https://www.google.com/cloudprint/learn/howitworks.html

Hi @max_morais_dmm

Do users need to go through a print dialogue or prompt when they click on the print button?

Thanks!

@mulyadi-agtechsg, in case of an attachment to print, a dialog will be prompted to you choice a attachment, for print formats or esc/pos no dialog, due you will store the print job configuration into the action

@pee because google cloud print don’t support ESC/POS printers

@Randy_Lowery I fixed the issue, you can install the app now

i did and i must say your app is beyond awesomeness having the default printer selected for each report is the best aproach for business the only down side of printing via internet is the lactancy due to speed limits, have you ever tried to integrate the app to work with the samba printing services for local printing?

@Randy_Lowery, in fact I don’t checked that due some interesting real testing cases:

I’m a software developer hosted at SP Brazil
The company hardware stock is in Miami or Montevideo - UY
Our datacenters are hosted in a french company.

The time to send a job to a printer, is extremelly small, we experimented around 1 or 2 seconds of latency.

Another point is, we decided to use Print Node, to reduce the complexity across many platforms. Due the Print Node API is extremelly simple, we can print from Android, from Windows, from MacOS, from Linux with just a click.

I don’t think that 1 or 2 seconds of latency in my scenario is something to worry and put effort in solve another complex things, like the Hardware communication in multiple platforms.

You are right, by now a have tested in diferent laser printer and the format are correct but in the dot matrix printer like epson lx300 + and epson tmu-220D the print job gets rendered in a diferent way than printing directly from browser (in epson lx300 fonts are way big and in the tmu its unreadable i have custom css and html for report, any advice for this situation is there somthing i must change in the report code?

@Randy_Lowery I’m using exactly the same methods that frappe use, so when you print a PDF from browser of print a Print Format from Print Node Integration, it should not have to make difference, but in ESC/POS, I’ve been noticed that, some times, you need to change some printer configuration

1 Like

ok thank you @max_morais_dmm ill give it a try!

@max_morais_dmm can we use this to just print item barcode by sending raw text/ZPL then the printer will print the barcode?

Frappe doesn’t has barcode generator built-in… So does your app support this?

@jof2jc yes you can use this app for that purpose

@max_morais_dmm anything needs to configure from to use this? Or just install the app?

Regarding barcode label, can I select some items from master with barcode codes then printer will just print out the label along with price?

I mean what the steps to print out barcode label from erpnext using this Print Node app?

@jof2jc you need to install the app, and setup your Print Node Account.

In the Print Node Settings doctype, you will be able to setup the “Actions” that make a button into the doctypes propertly configured. This is a shortcut to send the instruction and content for the printer using Print Formats to be rendered of files.

So you need design your Label in EPL or ZPL, put the templates marks in the print-format, so it will render the information that you need.

By now It dont send a “batch” of records to the printer, so I guess it can be implemented in the future.

PrintNode Settings Print Node Settings | Diigo
PrintNode Actions Print Node Actions | Diigo
Printer Capabilities Printer Capabilities | Diigo
ZPL Sample Zebra ZPL | Diigo
Actions Configured in Invoice Actions View in Invoice | Diigo

6 Likes

Thanks @max_morais_dmm I’ll try this app

Hey @max_morais_dmm ,
Does your App handle the dynamic printing of Point_of_sale receipt ?
like print only the size as much actual length is there of content and not need to constantly adjust from browser printing size if items are less or more.

Also is it possible somehow to have this without a print node account.
it would be great if thats the case…

Thanks

Yes, it already manage the size of the printing, without wast paper!

No, is not possible without an printnode account, because printnode is what manage the connection across many devices, including thermal printers, laser or deskjet, without any kind of special knowledgement of the device from my side.

2 Likes