react-native-thermal-receipt-printer-image-qr
react-native-thermal-receipt-printer-image-qr copied to clipboard
Image not found
I'm unable to print image from URL. I also tried using printImageBase64 but it prints out random characters.
code:
Printer.printImage(https://static01.nyt.com/images/2012/10/31/dining/31STUFF_APPLES/31STUFF3-jumbo.jpg
, {
imageWidth: 300,
imageHeight: 300,
});
result: image not found
Hi there,
I do have the same issue.
I am working on a Samsung Tablet.
I have tried the example of the repository, everything is working and being printed. Then I tried specific text for my project, everything is working and being printed. Then I tried to add the printImage function and I got a "Image not found" error.
Here is the piece of code : USBPrinter.printText("<C>Bon d'achat valable chez :</C>"); USBPrinter.printText("<D><C>BOCOLOCO</C><D>"); USBPrinter.printText("<C>Magasin 1 & 2</C>"); USBPrinter.printText("<C>Tous les jours de la semaine</C>"); USBPrinter.printText("<C>Magnifique</C>"); USBPrinter.printImage('https://sportshub.cbsistatic.com/i/2021/04/09/9df74632-fde2-421e-bc6f-d4bf631bf8e5/one-piece-trafalgar-law-wano-anime-1246430.jpg'); USBPrinter.printText("<C>453.45 €</C>");
What I have tried :
- Local image using require
- Adding width and height params
- Changing URL
Nothing is working. Do you have any solution ?
Here is my config, it's a fresh new app created 2 weeks ago : "react": "^18.0.0", "react-native": "0.69.1", "react-native-thermal-receipt-printer-image-qr": "^0.1.9",
Regards
@Florent75 i use this function to check you image url. you can try debugging here. https://github.com/thiendangit/react-native-thermal-receipt-printer-image-qr/blob/9ee324d230b306bba509341f90d5944770927a51/android/src/main/java/com/pinmi/react/printer/adapter/USBPrinterAdapter.java#L268-L272
Thanks. I will have a look and get back to you.
Hi there,
I updated the sdk version and now the image with URL is working.
Regards