Closed stephengladney closed 3 years ago
First thing to check is if you are using the correct emulation for your Printer, secondly check your printer command compatibility from the official StarSDK, not all printers allow all commands
Hello,
I had the same problem. My configs are Emulation: 'StarGraphic' My printer is: TSP100III TSP143IIIBI
I have used the native modules from the sample app and worked fine. Is there something I'm missing or is it some kind of limitation from the lib ?
Thanks in advance.
I have used the native modules from the sample app and worked fine. Is there something I'm missing or is it some kind of limitation from the lib ?
This is a limitation of the printer hardware, it is only able to support bitmap printing natively. As @infoxicator mentioned, please check the SDK documentation for compatibility details. When using "StarGraphic" emulation, the commands related to text printing are not available.
@stephengladney Did you find any solutions?
@molchanovskiy I'm stuck using appendBitmapText
for the moment. The only other function from the entire library that I was able to get to work was the appendQrCode.
@stephengladney Same here :((
@molchanovskiy @stephengladney, unfortunately, this is a limitation of your printer model and the SDK, not the library itself 👍
Thanks for this issue otherwise I would have thought this library was no use! This isn't aren't included in the types (having to cast any)
This seems to be a common difficulty, I.m a software engineer work for Star although (currently) I haven't used React Native so It's difficult to give any definite solution.
This library seems to be a very thin wrapper for the standard iOS or Android SDK's. On those platforms, StarGraphic only printing is generally handled by using the local canvas/drawing API, building the print job as an image, and then printing via the appendBitmap() method. Many developers prefer this method even, as it gives them much richer design options, font choices etc.
Is this approach viable with React Native?
@Lozrus appendBitmapText
does work but the styling options are limited to: width, font, fontSize, bothScale, alignment
So you don't get things like bold, inverted, etc
Is this approach viable with React Native?
@Lozrus we had done a custom build that we'd send HTML to, render the web view then send that image. We can't actually use the appendBitmapText
as it doesn't allow use the flexibility to align. What we're doing now it rendering a view and capturing it then sending over that image using https://github.com/gre/react-native-view-shot however it can't do web views that well so we have to build out everything as components in a scroll view.
We ended up switching to the 650II model for our customers because it accepts text printing.
@stephengladney you said:
appendBitmapText
does work but the styling options are limited to: width, font, fontSize, bothScale, alignment
I can't set alignment with appendBitmapText
command. Neither command's own alignment attribute nor appendAlignment
command makes any difference. Every line gets printed left aligned. Were you able to change alignment since you said it's one of the styling options with the appendBitmatText command above?
When testing the example from the documentation...
The printer only cuts the paper. It does not print any text.
I was finally able to get it to print text with the
appendBitmapText
param. I am able to change fontSize on these commands. However, I cannot use methods like:The result is a very constrained set of formatting and styling.