katzer / cordova-plugin-printer

Print HTML documents
Apache License 2.0
312 stars 291 forks source link

Printing to "(null)" #191

Closed kieranbarlow closed 5 years ago

kieranbarlow commented 6 years ago

Why is this plugin still being recommended on Ionic Native when no support is being given?

I have installed this plugin and followed the instructions, I am passing a printerID but I get the pop up:

Printing to "(null)" Failed to Contact Printer

I have two questions:

1) Why is this pop up a thing, can we disable 2) Is there a way to specify an ip address of the printer we want to connect to

Kev1n337 commented 6 years ago

You can specify an network URL in PrintOptions.

this.printer.print(content, {printerId: 'networkURL'})

When you add an invalid value there, you'll get the described error "printing to "(null)". When you don't specify a value at all, you'll be redirected to the default AirPrint view, where you can search for printers. (Same for android).

You can find more options to add in the official docs

katzer commented 5 years ago

It means that the printer you've specified does not exist.

jsitu commented 4 years ago

@katzer can we capture the printer network URL when it's selected from the list?