react-native-esc-pos-printer
react-native-esc-pos-printer copied to clipboard
TM-m30II-NT usb Base64 image @ IOS - NSInvalidArgumentException
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!!
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?
@tr3v3r do you have any soloution for that, Facing this issue too base64 not printing on IOS..
@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.