tr3v3r / react-native-esc-pos-printer

An unofficial React Native library for printing on an EPSON TM printer with the Epson ePOS SDK for iOS and Epson ePOS SDK for Android
MIT License
137 stars 64 forks source link

Fix: Disable trimming of text with textLine #117

Closed tolypash closed 10 months ago

tolypash commented 10 months ago

There is an issue where when I use textLine method, it trims the beginning of the text. I tracked this issue down to the wordwrapjs package. This is an issue since I want to be able to prepend spaces to some of my text lines.

For example:

printing.textLine(charsPerLine, {
  left: "1 Burger",
  right: "€ 5.00"
})

printing.textLine(charsPerLine, {
  left: "   + Cheese",
  right: "€ 0.10",
})

This would print:

1 Burger            € 5.00
+ Cheese            € 0.10

When it should have printed:

1 Burger            € 5.00
   + Cheese         € 0.10

By providing noTrim option to wordwrapjs, this issue is resolved.

tolypash commented 10 months ago

@tr3v3r

tr3v3r commented 10 months ago

2.6.0 is available in npm

cc: @tolypash