Ionic - printer for Android PDA


#1

I am writing an billing application using the ionic framework. How do I print the bill on my device.

My Device Name - Armada CT200 .
Its an Android PDA Device attached with thermal printer.

Kindly any one please send me code for printer.

Thanks in advance.


#2

Did you already look for Ionic Native or Cordova plugins that can use a printer to print things?


#3

I Used the following plug-in -

ionic cordova plugin add de.appplant.cordova.plugin.printer

But its doesn’t work.


#4

What does that mean do you get an error message? Can you print only with some printers?
Did you implement the plugin directly or via https://ionicframework.com/docs/native/printer/?
What is your ionic info output?


#5

ionic info

Your system information:

ordova CLI: 7.0.1
Ionic Framework Version: 3.6.0
Ionic CLI Version: 2.2.3
Ionic App Lib Version: 2.2.1
Ionic App Scripts Version: 2.1.3
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Windows 7
Node Version: v6.11.1
Xcode version: Not installed

I used the plugin via https://ionicframework.com/docs/native/printer/

It Doesn’t throw any error.

I Used the following code -

this.printer.isAvailable().then((onsuccess: any) => {

    let options: PrintOptions = {
        name: 'MyDocument',
        printerId: 'printer007',
        duplex: true,
        landscape: true,
        grayscale: true
    };
   this.printer.print('<h1>aaa</h1>',options).then((value: any) => {
            console.log('value:', value);
        }, (error) => {
            console.log('error:', error);
        });

}, (err) => {
    console.log('err:', err)
});

#6

That is ancient and broken - upgrade to a recent 3.x version.

Does it log an error?

What exact steps did you follow to install?


#7

first of all
I need to know how to run the app in PDA Device ?