Comments (2)
hi, this issues already solve?
from thermal-printer-cordova-plugin.
Just tried on capacitor 5 but it does not work. SDK30&31 both does not work. The error i see is the following:
tPrinter is declared and used as per sample on the main page:
` import { Printer, ThermalPrinterPlugin } from 'thermal-printer-cordova-plugin/src'; declare let tPrinter: ThermalPrinterPlugin; tPrinter.listPrinters({type: 'bluetooth'}, function(printers) { alert(printers); if (printers.length > 0) { var pr = printers[0] as Printer; tPrinter.requestPermissions({ type: 'bluetooth', id: 'SPP-R400' }, function() { // Permission granted - We can print! tPrinter.printFormattedText({ type: 'bluetooth', id: 4, text: '[C]<u> Hello World</u>' // new lines with "\n" }, function() { console.log('Successfully printed!'); }, function(error) { console.error('Printing error', error); }); }, function(error) { alert('Permission'); console.error('Permission denied - We can\'t print!'); }); } else { console.error('No printers found!'); } }, function(error) { console.error('Ups, we cant list the printers!', error); }); `
Another problem is that when you install it from npm:
npm install thermal-printer-cordova-plugin
it will install a version old 2 years so the package also on npmjs should be updated.
Hi you can try this package https://www.npmjs.com/package/thermal-printer-cordova-plugin-modified with version 1.0.8
And you should not call requestPermission method when the type of device is Bluetooth. also the id should be printer's address (bluetooth device), or deviceId (usb device), you could find those informations in the document.
Hope this could help.
Best.
from thermal-printer-cordova-plugin.
Related Issues (20)
- App closes at printer check with Ionic 6 (Android 12 & API 31) HOT 1
- 'listPrinters', which lacks return-type annotation, implicitly has an 'any' return type. HOT 3
- Can i Use 80mm Paper? HOT 2
- Missing permission for android.permission.DISABLE_KEYGUARD HOT 17
- How To Trigger Open Cash Drawer ? HOT 3
- noting printing in zebra printer
- Change Charset Encoding HOT 8
- mmfeedpage and dotfeedpage not working
- Duplicate Class com.google.zxing
- ThermalPrinter.printFormattedText via bluetooth
- Application crashes when calling ThermalPrinter.requestPermissions HOT 2
- Unable to Print Image Using bitmapToHexadecimalString()
- Can you print base64 pdf? HOT 3
- Target SDK 33 app is crashed. HOT 4
- Update API 33 HOT 3
- Print line Height
- Missing permission for android.permission.DISABLE_KEYGUARD HOT 1
- PrinterWidthMM is not a parameter for printFormattedTextAndCut
- Property 'id' does not exist on type 'Printer'.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from thermal-printer-cordova-plugin.