Printing on bluetooth printers

#1

I am writing an billing application using the ionic framework. How do I print the bill on a bluetooth printer.

Rajesh.

3 Likes
#2

You can do with airprint. Master branch works for me.

#3

Anyone tried this with Android Printing Framework? Would be great to have a confirmation that it works

#4

i use https://github.com/srehanuddin/Cordova-Plugin-Bluetooth-Printer and it works.

1 Like
#6

Hi tumbas
can you please help me by sharing your controller
i tried with Cordova-Plugin-Bluetooth-Printer but i cannot printing

#7

Hi well in my case I wrote a little plugin for a bluetooth thermal printers. models RPP200 and RPP300. I bougth in china and the doc was very bad, i found an example and made a plugin for can be used very simple. I hope this can help someone more.

#8

i’m not able to install it.
printer Abhi$ cordova plugin add https://github.com/srehanuddin/Cordova-Plugin-Bluetooth-Printer.git
Error: Failed to fetch plugin https://github.com/srehanuddin/Cordova-Plugin-Bluetooth-Printer.git via registry.
Probably this is either a connection problem, or plugin spec is incorrect.
Check your connection and plugin name/version/URL.
Error: npm: Command failed with exit code 1 Error output:
npm ERR! cb() never called!

npm ERR! This is an error with npm itself. Please report this error at:
npm ERR! https://github.com/npm/npm/issues

npm ERR! A complete log of this run can be found in:
npm ERR! /Users/hardikjani/.npm/_logs/2017-07-29T10_38_32_042Z-debug.log
Hardiks-Mac-mini-2:printer Abhi$ ionic cordova plugin add https://github.com/srehanuddin/Cordova-Plugin-Bluetooth-Printer.git

cordova plugin add https://github.com/srehanuddin/Cordova-Plugin-Bluetooth-Printer.git --save
:heavy_multiplication_x: Running command - failed!

[ERROR] Cordova encountered an error.
You may get more insight by running the Cordova command above directly.

[ERROR] An error occurred while running cordova plugin add
https://github.com/srehanuddin/Cordova-Plugin-Bluetooth-Print… (exit
code 1):

    Error: Failed to fetch plugin
    https://github.com/srehanuddin/Cordova-Plugin-Bluetooth-Printer.git via
    registry.
    Probably this is either a connection problem, or plugin spec is
    incorrect.
    Check your connection and plugin name/version/URL.
    Error: npm: Command failed with exit code 1 Error output:
    npm ERR! cb() never called!
    
    npm ERR! This is an error with npm itself. Please report this error at:
    npm ERR!     <https://github.com/npm/npm/issues>
    
    npm ERR! A complete log of this run can be found in:
    npm ERR!
    /Users/hardikjani/.npm/_logs/2017-07-29T10_40_07_824Z-debug.log

Hardiks-Mac-mini-2:printer Abhi$ ionic cordova plugin add Cordova-Plugin-Bluetooth-Printer

cordova plugin add Cordova-Plugin-Bluetooth-Printer --save
:heavy_multiplication_x: Running command - failed!

[ERROR] Cordova encountered an error.
You may get more insight by running the Cordova command above directly.

[ERROR] An error occurred while running cordova plugin add
Cordova-Plugin-Bluetooth-Printer --save (exit code 1):

    Error: Registry returned 404 for GET on
    https://registry.npmjs.org/Cordova-Plugin-Bluetooth-Printer
#9

Not sure if you got it working, but I managed to print via bluetooth serial. Here’s my github:

2 Likes
#10

Sorry but It don’t work :frowning:

#11

Try git clone and npm install, it should work.

#13

Now is working more or less I change the connection method, thanks!

#14

Its working fine but while checking the connection it’s doesn’t connecting to the device as well as while printing the test data its not printing.can you give any other solution.

Thanks
Pvreddy

#15

It should work, the connection to the bluetooth terminal is in the provider

#16

Yeah thanks for replying.Its working fine now.

#17

Hi,

Thank you so much, your plugin is the best!

I could connect the therminal Printer, but when I want a Test Print it show me the alert “ERROR Unable to connect to device”.

Can you please help me?

#18
  1. I would recommend ‘git clone’ and ‘npm install’ the code first. Play around with my code, understand it and then take the bits and pieces you want to use. Don’t copy by batches from the start because it usually won’t work that way.

  2. You have to connect to the bluetooth printer first.
    This line of code should run05%20PM

  3. Once this has run, you should be able to execute this line.

Please try again and if it is still a problem, let me know on twitter @razmans

2 Likes
#19

Hi @razmans,
It Works perfectly.

Thank you so much!!! :slight_smile:

2 Likes
#20

thank you, your plugin works perfectly.
Please, Have you already found a solution to print a Barcode or a Qrcode?

2 Likes
#21

Hi @razmans i am using evolute leopad printer, i clone your project and checked. My blue tooth printer listing out and test connection is successful but when i click on test print it show PRINT SUCCESS alert message but data is not printed in paper. In-build app of evolute leopad is working but with this plugin is not working.Please help me to solve this issue.
refer printer link:

#22

hi

i need to bold and set the size of printing data how can i do this pleas help