react-native-esc-pos-printer icon indicating copy to clipboard operation
react-native-esc-pos-printer copied to clipboard

TM-m30II-NT usb Base64 image @ IOS - NSInvalidArgumentException

Open 592da opened this issue 1 year ago • 3 comments

Hello!

I am trying to send the printer an image via USB.

I get the following error:

NSInvalidArgumentException: *** -[NSURL URLByAppendingPathComponent:]: component, components, or pathExtension cannot be nil.

device properly discovered and initialized

{
printer: {
bt: , 
ip: , 
mac: , 
name: TM-m30II-NT, 
target: USB:583939500274300000, 
usb: 583939500274300000
}
}

but once I sent the printing commands:

printing
        .initialize()
        .align("center")
        .newline()
        .image({ uri: image }, { width: this.options.adapter.escWidth })
        .newline()
        .cut()
        .send();

I get the error above

I checked i am sending a proper base64 string like in the example and the docs "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAjoA ... " (189512 length)

I tried also to pass a temporary file as URL for URI / require it but it didn't worked because cannot transform requires on runtime

any suggestions?

working with iPad Air 5gen ios 16.5

Thanks!!

592da avatar Jun 15 '23 13:06 592da

how can you connect with epson via usb? my ipad have problem can not connect with epson via usb, the discover printer function return empty list printers. Can you show me how you do?

hangkimduyen avatar Sep 14 '23 04:09 hangkimduyen

@tr3v3r do you have any soloution for that, Facing this issue too base64 not printing on IOS..

ahmad71666 avatar Dec 13 '23 10:12 ahmad71666

@ahmad71666 It works for me. Please try to run this project and check if it works or not.

https://github.com/tr3v3r/react-native-esc-pos-printer/tree/main/example

If it's not please add more details here. lib version, logs, device, rn version and etc.

tr3v3r avatar Dec 13 '23 12:12 tr3v3r