Printer

Contents

Prints documents or HTML rendered content

https://github.com/katzer/cordova-plugin-printer

Ionic 打印 Printer插件的安装(Installation)

ionic cordova plugin add cordova-plugin-printer npm install @ionic-native/printer

Ionic 打印 Printer插件支持的平台(Supported Platforms)

  • Android
  • iOS
  • Windows

Ionic 打印 Printer插件的用法(Usage)

import { Printer, PrintOptions } from '@ionic-native/printer';

constructor(private printer: Printer) { }

...

this.printer.isAvailable().then(onSuccess, onError);

let options: PrintOptions = {
     name: 'MyDocument',
     printerId: 'printer007',
     duplex: true,
     landscape: true,
     grayscale: true
   };

this.printer.print(content, options).then(onSuccess, onError);