januslo / react-native-sunmi-inner-printer

http://docs.sunmi.com/htmls/index.html?lang=zh##V1文档资源 根据商米V1文档开发的热敏打印
MIT License
74 stars 121 forks source link

Why printBitmap did the first print fail, and each subsequent print is the result of the previous one? #63

Open githubLXD333 opened 3 years ago

phabiulla commented 3 years ago

Any news here?

jeffreyvanhees commented 2 years ago

Same problem here. Looks like it's something with buffer.

jeffreyvanhees commented 2 years ago

I've found a solution. Print a newline after the bitmap like:

await InnerPrinter.printBitmap(base64, width, height);
await InnerPrinter.printOriginalText('\n');

Sunmi docs says in some places: "The force line breaker "\n" must be added to the end of a line of content which not fully occupy". I think this is also the case for a bitmap that has not the full width or something. S

See https://file.cdn.sunmi.com/SUNMIDOCS/%E5%95%86%E7%B1%B3%E5%86%85%E7%BD%AE%E6%89%93%E5%8D%B0%E6%9C%BA%E5%BC%80%E5%8F%91%E8%80%85%E6%96%87%E6%A1%A3EN-0224.pdf (page 11)