tauri-plugin-thermal-printer 1.3.1 → 1.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -6
- package/dist-js/index.d.ts +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -285,7 +285,7 @@ try { await test_thermal_printer({
|
|
|
285
285
|
"beep": true,
|
|
286
286
|
"open_cash_drawer": false,
|
|
287
287
|
"code_page": {
|
|
288
|
-
"
|
|
288
|
+
"code_page": 6,
|
|
289
289
|
"encode": ENCODE.WINDOWS_1252,
|
|
290
290
|
"use_gbk": false
|
|
291
291
|
}
|
|
@@ -356,7 +356,7 @@ try { await print_thermal_printer({
|
|
|
356
356
|
"beep": false,
|
|
357
357
|
"open_cash_drawer": false,
|
|
358
358
|
"code_page": {
|
|
359
|
-
"
|
|
359
|
+
"code_page": 6,
|
|
360
360
|
"encode": ENCODE.WINDOWS_1252,
|
|
361
361
|
"use_gbk": false
|
|
362
362
|
}
|
|
@@ -891,7 +891,7 @@ The plugin exports typed constants and builder functions so you never have to ty
|
|
|
891
891
|
|
|
892
892
|
Set the character encoding once in `PrinterOptions.code_page` and all text sections (`Title`, `Subtitle`, `Text`, `Table`) will use it automatically.
|
|
893
893
|
|
|
894
|
-
Each printer model assigns its own `ESC t n` values, so `CodePage.
|
|
894
|
+
Each printer model assigns its own `ESC t n` values, so `CodePage.code_page` accepts the raw page number directly. `CodePage.encode` controls the host-side encoding used before bytes are sent to the printer. `CodePage.use_gbk` explicitly controls whether characters that the selected `encode` cannot represent should be retried with GBK before falling back to the original UTF-8 bytes.
|
|
895
895
|
|
|
896
896
|
```typescript
|
|
897
897
|
import { ENCODE, type CodePage } from "tauri-plugin-thermal-printer";
|
|
@@ -901,7 +901,7 @@ const options = {
|
|
|
901
901
|
beep: false,
|
|
902
902
|
open_cash_drawer: false,
|
|
903
903
|
code_page: {
|
|
904
|
-
|
|
904
|
+
code_page: 6,
|
|
905
905
|
encode: ENCODE.WINDOWS_1252,
|
|
906
906
|
use_gbk: false,
|
|
907
907
|
}, // sends ESC t 6
|
|
@@ -912,7 +912,7 @@ const options = {
|
|
|
912
912
|
|
|
913
913
|
| Field | Required | Description |
|
|
914
914
|
|---|---|---|
|
|
915
|
-
| `
|
|
915
|
+
| `code_page` | ✅ Yes | Raw `ESC t n` value sent to the printer. |
|
|
916
916
|
| `encode` | ❌ No | Host-side encoding strategy. Defaults to `ENCODE.ACCENT_REMOVER`. |
|
|
917
917
|
| `use_gbk` | ❌ No | Retries GBK for characters that `encode` cannot represent before falling back to the original UTF-8 bytes. Defaults to `false`. |
|
|
918
918
|
|
|
@@ -1072,7 +1072,7 @@ const job: PrintJobRequest = {
|
|
|
1072
1072
|
beep: false,
|
|
1073
1073
|
open_cash_drawer: false,
|
|
1074
1074
|
code_page: {
|
|
1075
|
-
|
|
1075
|
+
code_page: 6,
|
|
1076
1076
|
encode: ENCODE.WINDOWS_1252,
|
|
1077
1077
|
use_gbk: false,
|
|
1078
1078
|
},
|
package/dist-js/index.d.ts
CHANGED