Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70435

Ionic Printer: TypeError: "path is undefined"

$
0
0

@NorthFred wrote:

Hi,

I’m getting the error “TypeError: path is undefined” in the browser’s developer console when I try to run the following code:

import { Printer, PrintOptions } from '@ionic-native/printer/ngx';
    constructor(
      public viewCtrl: ViewController,
      public navParams: NavParams,
      private printer: Printer
    ) {....
       let printerOptions = {
        name: `Print Job`,
        printerId: 'GoDEX G500',
        duplex: false,
        landscape: true,
        grayscale: true
      };

       let printContent = "<h1>Hello World!</h1>";

      this.printer.print(printContent, printerOptions)
      .then( () => {
        console.log("Data sent to printer!");
      })
      .catch(error => {
        console.log(error);
      });

I tried to find out where this “path” is coming from, without success. It does however come from the Printer component, that is for sure.

Does anyone know where this might come from? A search on the mighty interwebz did not result in anything :confused:

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 70435

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>