paystory-de / thermal-printer-cordova-plugin

Cordova wrapper for ESC/POS Thermal Printer library
Apache License 2.0
49 stars 33 forks source link

'ThermalPrinter' is not defined. #7

Closed karolinessz closed 2 years ago

karolinessz commented 2 years ago

I'm using this plugin with capacitor, vuejs and vuetify and I can't call any method because it keeps saying 'ThermalPrinter' is undefined. Is there another way I could use it?

gugumetal commented 2 years ago

I have the same problem

patrickbussmann commented 2 years ago

I'll check soon but do you have example code so that I can fix it quicker than without? Thank you!

patrickbussmann commented 2 years ago

I added example code now. Maybe you can try again? Or providing me example code.

My apps are written in Capacitor, too. - no issues.

@karolinessz @gugumetal

rajeshsolankijodhpur commented 2 years ago

hi patrickbussmann i am using your paystory-de/thermal-printer-cordova-plugin URL https://github.com/paystory-de/thermal-printer-cordova-plugin i use all the function on document and all are work find can you provide any document or any other link to get getNbrCharactersPerLine() ,getPrinterWidthMM() , getPrinterDpi() and other method how i get these thing in my application

and how i use ESC/POS commands (https://www.sparkag.com.br/wp-content/uploads/2016/06/ESC_POS-AK912-English-Command-Specifications-V1.4.pdf)

jpatdu-credovita commented 2 years ago

I ran into this issue too in my Svelte app. What ultimately solved it for me were two things:

  1. Just use TypeScript. Svelte's starter template has a script to enable typescript.
  2. Replace @rollup/plugin-typescript with rollup-plugin-typescript2. Build fails using the former. See my repo of my sample app: https://github.com/jpatdu-credovita/capacitor-svelte-ts-escpos