Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
E
esc_pos_print_plus
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Dio Maulana
esc_pos_print_plus
Commits
b8b6c9aa
Commit
b8b6c9aa
authored
Sep 14, 2019
by
Andrey
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Kanji commands
parent
799e4de3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
5 deletions
+9
-5
commands.dart
lib/src/commands.dart
+4
-2
printer.dart
lib/src/printer.dart
+5
-3
No files found.
lib/src/commands.dart
View file @
b8b6c9aa
...
@@ -33,7 +33,8 @@ const cFontB = '${esc}M1'; // Font B
...
@@ -33,7 +33,8 @@ const cFontB = '${esc}M1'; // Font B
const
cTurn90On
=
'
${esc}
V1'
;
// Turn 90° clockwise rotation mode on
const
cTurn90On
=
'
${esc}
V1'
;
// Turn 90° clockwise rotation mode on
const
cTurn90Off
=
'
${esc}
V0'
;
// Turn 90° clockwise rotation mode off
const
cTurn90Off
=
'
${esc}
V0'
;
// Turn 90° clockwise rotation mode off
const
cCodeTable
=
'
${esc}
t'
;
// Select character code table [N]
const
cCodeTable
=
'
${esc}
t'
;
// Select character code table [N]
const
cKanjiCancel
=
'
$fs
.'
;
// Cancel Kanji character mode
const
cKanjiOn
=
'
$fs
&'
;
// Select Kanji character mode
const
cKanjiOff
=
'
$fs
.'
;
// Cancel Kanji character mode
// Print Position
// Print Position
const
cAlignLeft
=
'
${esc}
a0'
;
// Left justification
const
cAlignLeft
=
'
${esc}
a0'
;
// Left justification
...
@@ -50,7 +51,8 @@ const cRasterImg = '${gs}v0'; // Print raster bit image [obsolete command]
...
@@ -50,7 +51,8 @@ const cRasterImg = '${gs}v0'; // Print raster bit image [obsolete command]
const
cBitImg
=
'
$esc
*'
;
// Set bit image mode
const
cBitImg
=
'
$esc
*'
;
// Set bit image mode
// Barcode
// Barcode
const
cBarcodeSelectPos
=
'
${gs}
H'
;
// Select print position of HRI characters [N]
const
cBarcodeSelectPos
=
'
${gs}
H'
;
// Select print position of HRI characters [N]
const
cBarcodeSelectFont
=
'
${gs}
f'
;
// Select font for HRI characters [N]
const
cBarcodeSelectFont
=
'
${gs}
f'
;
// Select font for HRI characters [N]
const
cBarcodeSetH
=
'
${gs}
h'
;
// Set barcode height [N]
const
cBarcodeSetH
=
'
${gs}
h'
;
// Set barcode height [N]
const
cBarcodeSetW
=
'
${gs}
w'
;
// Set barcode width [N]
const
cBarcodeSetW
=
'
${gs}
w'
;
// Set barcode width [N]
...
...
lib/src/printer.dart
View file @
b8b6c9aa
...
@@ -115,7 +115,9 @@ class Printer {
...
@@ -115,7 +115,9 @@ class Printer {
// Cancel Kanji mode
// Cancel Kanji mode
if
(
cancelKanji
)
{
if
(
cancelKanji
)
{
_socket
.
write
(
cKanjiCancel
);
_socket
.
write
(
cKanjiOff
);
}
else
{
_socket
.
write
(
cKanjiOn
);
}
}
// Set local code table
// Set local code table
...
@@ -137,7 +139,7 @@ class Printer {
...
@@ -137,7 +139,7 @@ class Printer {
/// Sens raw command(s)
/// Sens raw command(s)
void
sendRaw
(
List
<
int
>
cmd
,
{
bool
cancelKanji
=
true
})
{
void
sendRaw
(
List
<
int
>
cmd
,
{
bool
cancelKanji
=
true
})
{
if
(
cancelKanji
)
{
if
(
cancelKanji
)
{
_socket
.
write
(
cKanji
Cancel
);
_socket
.
write
(
cKanji
Off
);
}
}
_socket
.
add
(
Uint8List
.
fromList
(
cmd
));
_socket
.
add
(
Uint8List
.
fromList
(
cmd
));
}
}
...
@@ -165,7 +167,7 @@ class Printer {
...
@@ -165,7 +167,7 @@ class Printer {
/// If [codeTable] is null, global code table is used.
/// If [codeTable] is null, global code table is used.
/// If global code table is null, default printer code table is used.
/// If global code table is null, default printer code table is used.
void
printCodeTable
({
PosCodeTable
codeTable
})
{
void
printCodeTable
({
PosCodeTable
codeTable
})
{
_socket
.
write
(
cKanji
Cancel
);
_socket
.
write
(
cKanji
Off
);
if
(
codeTable
!=
null
)
{
if
(
codeTable
!=
null
)
{
_socket
.
add
(
_socket
.
add
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment