@@ -114,7 +114,42 @@ final PosPrintResult res = await printerManager.printTicket(testTicket());
...
@@ -114,7 +114,42 @@ final PosPrintResult res = await printerManager.printTicket(testTicket());
print('Print result: ${res.msg}');
print('Print result: ${res.msg}');
```
```
For more details, check *example/example.dart* and *example/discover_printers*.
For more details, check `example/example.dart` and `example/discover_printers`.
## Using Code Tables
Thanks to the [charset_converter](https://pub.dev/packages/charset_converter) package, it's possible to print in different languages. The source text should be encoded using the corresponding charset and the correct charset should be passed to the `Ticket.textEncoded` method.
Here are some examples:
```dart
/// Portuguese
Uint8ListencTxt1=awaitCharsetConverter.encode(
"cp860","Portuguese: Olá, Não falo português, Cão");
Note that `CharsetConverter.encode` takes a platform-specific charset (check the [library documentation](https://pub.dev/packages/charset_converter) for more info).
Note that different printers may support different sets of codetables and the above examples may not work on some printer models. It's also possible to pass a codetable by its code (according to your printer's documentation): `PosStyles(codeTable: PosCodeTable(7))`.