GithubHelp home page GithubHelp logo

Comments (8)

thiendangit avatar thiendangit commented on April 27, 2024

@rohitatcoffee please try to using this function : printImageBase64

from react-native-thermal-receipt-printer-image-qr.

rohitatcoffee avatar rohitatcoffee commented on April 27, 2024

@rohitatcoffee please try to using this function : printImageBase64

Yes, I tried that one too. printImageBase64 only takes base64 data not local image URI.
I am using Everycom EC-58 58mm printer

from react-native-thermal-receipt-printer-image-qr.

thiendangit avatar thiendangit commented on April 27, 2024

you can using this lib to capture -> covert to base64-> print
https://github.com/gre/react-native-view-shot

from react-native-thermal-receipt-printer-image-qr.

rohitatcoffee avatar rohitatcoffee commented on April 27, 2024

I am doing the following things,

  1. Render data in Webview
  2. Capture screenshots using https://github.com/gre/react-native-view-shot
  3. Then convert screenshot to base64 using react-native-fs and print using Printer.printImageBase64(res, { beep: false, imageWidth:600});

But still getting messed up data.

[](https://i.ibb.co/hf3JKqg/20220407-183129.jpg)

from react-native-thermal-receipt-printer-image-qr.

thiendangit avatar thiendangit commented on April 27, 2024

maybe your base64 is wrong!
try this :

let qrProcessed = dataURL.replace(/(\r\n|\n|\r)/gm, "");

from react-native-thermal-receipt-printer-image-qr.

rohitatcoffee avatar rohitatcoffee commented on April 27, 2024

@thiendangit I am able to solve this issue, the issue was the width. I was passing images with the wrong dimensions.

from react-native-thermal-receipt-printer-image-qr.

yaser-elbatal avatar yaser-elbatal commented on April 27, 2024

@thiendangit I am able to solve this issue, the issue was the width. I was passing images with the wrong dimensions.

what is the best dimensions?

from react-native-thermal-receipt-printer-image-qr.

OhFarhan avatar OhFarhan commented on April 27, 2024

if you are printing in a small printer use image width less than 200 or 300 @rohitatcoffee

from react-native-thermal-receipt-printer-image-qr.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.