Skip to content

Commit a33b20b

Browse files
authored
Encoding (#10)
* iOS encoding + appendEncoding + appendCodePage + appendBytes * Android Encoding +encoding +codePageType +appendBytes +enableEmphasis +enableInvert +enableUnderline +enableAppend * enable commands +enableEmphasis +enableInvert +enableUnderline +enableMultiple * Version 2.1.0 +appendEncoding +appendCodePageType +appendBytes +appendRawBytes +enableEmphasis +enableInvert +enableUnderline +enableMultiple
1 parent 0829173 commit a33b20b

File tree

5 files changed

+308
-87
lines changed

5 files changed

+308
-87
lines changed

README.md

Lines changed: 63 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -287,12 +287,19 @@ window.addEventListener('starPrntData', function (e) {
287287

288288
| Property (Command) | Description |
289289
| ----------- | -------- |
290-
| append: string | Data (Text and Command) is added to the command buffer. Example: ```{append:"Star Clothing Boutique\n123 Star Road\nCity, State 12345\n\n"} ``` |
291-
| appendRaw: string | Data (Text and Command) is added to the command buffer. Example: ```{appendRaw:"Star Clothing Boutique\n123 Star Road\nCity, State 12345\n\n"}``` |
290+
| appendEncoding: string | Characther encoding is used to getByte data from all subsequent commands. Default 'US-ASCII' Choose the format of the return value Defined in [Encoding](#encoding) Example: ```{appendEncoding:'US-ASCII'}``` |
291+
| appendCodePage: string | Select command of the code page is generated and added to the commands property.Choose the format of the return value Defined in [CodePageType](#codepagetype) Example: ```{appendCodePage:'CP858'}``` |
292+
| appendBytes: Array | Data (Command) is added to the command buffer. Takes an array of bytes. Example: ``` {appendBytes:[0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x20, 0x57, 0x6f, 0x72, 0x6c, 0x64, 0x2e]}``` |
293+
| appendRawBytes: Array | Data (Command) is added to the command buffer. Takes an array of bytes. Example: ``` {appendRawBytes:[0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x20, 0x57, 0x6f, 0x72, 0x6c, 0x64, 0x2e]} ``` |
294+
| append: string | Data (Text) is added to the command buffer. Example: ```{append:"Star Clothing Boutique\n123 Star Road\nCity, State 12345\n\n"} ``` |
295+
| appendRaw: string | Data (Text) is added to the command buffer. Example: ```{appendRaw:"Star Clothing Boutique\n123 Star Road\nCity, State 12345\n\n"}``` |
292296
|appendCharacterSpace: number | Set command of the character space is generated and added to the command buffer. Character Spacs (Unit: Dots) Example: ```{appendCharacterSpace: 4}``` |
293297
|appendEmphasis: string | Select command of the emphasis mode is generated and added to the command buffer. Example: ```{appendEmphasis:"SALE\n"}``` |
298+
|enableEmphasis: boolean | Enable emphasis mode is generated and added to the command buffer. Example: ```{enableEmphasis:true}``` |
294299
| appendInvert: string | Select command of the invert mode is generated and added to the command buffer. Example: ```{appendInvert:"Refunds and Exchanges\n"}``` |
300+
| enableInvert: boolean | Enable invert mode is generated and added to the command buffer. Example: ```{enableInvert:true}``` |
295301
| appendUnderline: string | Select command of the under line mode is generated and added to the command buffer. Example: ```{appendUnderline:"30 days"}```|
302+
| enableUnderline: boolean| Enable under line mode is generated and added to the command buffer. Example: ```{enableUnderline:true}``` |
296303
| appendInternational: string | Select command of the international character mode is generated and added to the command buffer.Choose the format of the return value Defined in [InternationalType](#internationaltype) Example ```{appendInternational:'UK'}```|
297304
| appendLineFeed: number | Line feed command is generated and added to the command buffer. Paper feed units (Units: Lines) Example: ```{appendLineFeed:2}``` |
298305
| appendUnitFeed: number | Unit feed command is generated and added to the command buffer. Paper feed units (Units: Dots) Example: ```{appendUnitFeed:64}``` |
@@ -314,6 +321,7 @@ window.addEventListener('starPrntData', function (e) {
314321
| absolutePosition: number | Property to be used with the appendBitmap command, the appendBarcode command, or the appendQrCode command (Units:Dots). appendBitmap Example: ```{appendBitmap:uri, absolutePosition:40}```. appendBarcode Example: ```{appendBarcode:'{BStar', absolutePosition:40}```. appendQrCode Example: ```{appendQrCode:'{BStar', absolutePosition:40}```|
315322
| alignment: string | Property to be used with the appendBitmap command, the appendBarcode command, or the appendQrCode command (Units:Dots). Choose the format of the return value defined in [AlignmentPosition](#alignmentposition). appendBitmap Example: ```{appendBitmap:uri, alignment:'Center'}```.appendBarcode Example: ```{appendBarcode:'{BStar', alignment:'Center'}```. appendQrCode Example: ```{appendQrCode:'{BStar', alignment:'Center'}``` |
316323
| appendMultiple: string | Select command of the multiple mode is generated and added to the command buffer. Additional properties: width:number, height:number. Example: ```{appendMultiple:" $156.95\n", width:2, height:2}``` |
324+
| enableMultiple: boolean | Enable multiple mode is generated and added to the command buffer. Additional properties: width:number, height:number. Example: ```{enableMultiple:true, width:2, height:2}``` Disable Example: ```{enableMultiple:false}``` |
317325
| appendQrCode: string | Print command of the QR code is generated and added to the command buffer. Additional Properties: QrCodeModel, QrCodeLevel, cell, absolutePosition, alignment. Example: ```{appendQrCode:"{BStar", QrCodeModel:"No2", QrCodeLevel:"L", cell: 8}``` Example with absolutePosition: ``` {appendQrCode:"{BStar", QrCodeModel:"No2", QrCodeLevel:"L", cell: 8, absolutePosition: 40 }``` Example with alignment: ```{appendQrCode:"{BStar", QrCodeModel:"No2", QrCodeLevel:"L", cell: 8, alignment:"Center" }``` |
318326
| QrCodeModel: string | Property to be used with the appendQrCode command. Choose the format of the return value defined in [QrCodeModel](#qrcodemodel). Example: ```{appendQrCode:'{BStar', QrCodeModel:'No1'}``` |
319327
| QrCodeLevel: string |Property to be used with the appendQrCode command. Choose the format of the return value defined in [QrCodeLevel](#qrcodelevel) Example: ```{appendQrCode:'{BStar', QrCodeLevel:'H'}``` |
@@ -329,6 +337,59 @@ window.addEventListener('starPrntData', function (e) {
329337
## PrintCommand Constants:
330338
Values for the PrintCommand properties. (Case and type sensitive)
331339

340+
## Encoding
341+
| Encoding | Languages |
342+
| ----------- | -------- |
343+
| 'US-ASCII' | English |
344+
| 'Windows-1252' | French, German, Portuguese, Spanish |
345+
| 'Shift-JIS' | Japanese |
346+
| 'Windows-1251' | Russian |
347+
| 'GB2312' | Simplified Chinese |
348+
| 'Big5' | Traditional Chinese |
349+
| 'UTF-8' | UFT8 |
350+
351+
## CodePageType
352+
CP737 = 'CP737',
353+
CP772 = 'CP772',
354+
CP774 = 'CP774',
355+
CP851 = 'CP851',
356+
CP852 = 'CP852',
357+
CP855 = 'CP855',
358+
CP857 = 'CP857',
359+
CP858 = 'CP858',
360+
CP860 = 'CP860',
361+
CP861 = 'CP861',
362+
CP862 = 'CP862',
363+
CP863 = 'CP863',
364+
CP864 = 'CP864',
365+
CP865 = 'CP865',
366+
CP869 = 'CP869',
367+
CP874 = 'CP874',
368+
CP928 = 'CP928',
369+
CP932 = 'CP932',
370+
CP999 = 'CP999',
371+
CP1001 = 'CP1001',
372+
CP1250 = 'CP1250',
373+
CP1251 = 'CP1251',
374+
CP1252 = 'CP1252',
375+
CP2001 = 'CP2001',
376+
CP3001 = 'CP3001',
377+
CP3002 = 'CP3002',
378+
CP3011 = 'CP3011',
379+
CP3012 = 'CP3012',
380+
CP3021 = 'CP3021',
381+
CP3041 = 'CP3041',
382+
CP3840 = 'CP3840',
383+
CP3841 = 'CP3841',
384+
CP3843 = 'CP3843',
385+
CP3845 = 'CP3845',
386+
CP3846 = 'CP3846',
387+
CP3847 = 'CP3847',
388+
CP3848 = 'CP3848',
389+
UTF8 = 'UTF8',
390+
Blank = 'Blank'
391+
}
392+
332393
## InternationalType
333394
UK = 'UK',
334395
USA = 'USA',

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "cordova-plugin-starprnt",
3-
"version": "2.0.1",
3+
"version": "2.1.0",
44
"description": "StarPRNT Cordova Plugin for Star Micronics Bluetooth/LAN printers",
55
"types": "./types/index.d.ts",
66
"cordova": {

plugin.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version='1.0' encoding='utf-8'?>
2-
<plugin id="cordova-plugin-starprnt" version="2.0.1" xmlns="http://apache.org/cordova/ns/plugins/1.0" xmlns:android="http://schemas.android.com/apk/res/android">
2+
<plugin id="cordova-plugin-starprnt" version="2.1.0" xmlns="http://apache.org/cordova/ns/plugins/1.0" xmlns:android="http://schemas.android.com/apk/res/android">
33
<name>StarPRNT</name>
44
<description>Plugin to use Star printers and connected drawer</description>
55
<author>Jose Angarita / Ruben Casas</author>

0 commit comments

Comments
 (0)