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
7edeea6a
Commit
7edeea6a
authored
Mar 14, 2020
by
Andrey
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Readme: Added Print image examples. Updated `esc_pos_utils` package version to `0.3.2`.
parent
07faaf9b
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
27 additions
and
9 deletions
+27
-9
CHANGELOG.md
CHANGELOG.md
+4
-0
README.md
README.md
+14
-4
main.dart
example/discover_printers/lib/main.dart
+2
-1
pubspec.yaml
example/discover_printers/pubspec.yaml
+3
-1
example.dart
example/example.dart
+2
-1
pubspec.yaml
pubspec.yaml
+2
-2
No files found.
CHANGELOG.md
View file @
7edeea6a
## [3.1.2]
*
Updated
`esc_pos_utils`
package version to
`0.3.2`
.
## [3.1.1]
*
Updated
`esc_pos_utils`
package version to
`0.3.1`
(Open Cash Drawer).
...
...
README.md
View file @
7edeea6a
...
...
@@ -88,16 +88,26 @@ ticket.row([
### Print an image:
This package implements 3 ESC/POS functions:
*
`ESC *`
- print in column format
*
`GS v 0`
- print in bit raster format (obsolete)
*
`GS ( L`
- print in bit raster format
Note that your printer may support only some of the above functions.
```
dart
import
'dart:io'
;
import
'package:image/image.dart'
;
const
String
filename
=
'./logo.png'
;
final
Image
image
=
decodeImage
(
File
(
filename
).
readAsBytesSync
());
// Using (ESC *) command
final
ByteData
data
=
await
rootBundle
.
load
(
'assets/logo.png'
);
final
Uint8List
bytes
=
data
.
buffer
.
asUint8List
();
final
Image
image
=
decodeImage
(
bytes
);
// Using `ESC *`
ticket
.
image
(
image
);
// Using
an alternative obsolette (GS v 0) command
// Using
`GS v 0` (obsolete)
ticket
.
imageRaster
(
image
);
// Using `GS ( L`
ticket
.
imageRaster
(
image
,
imageFn:
PosImageFn
.
graphics
);
```
### Print a barcode:
...
...
example/discover_printers/lib/main.dart
View file @
7edeea6a
...
...
@@ -136,8 +136,9 @@ class _MyHomePageState extends State<MyHomePage> {
final
Uint8List
bytes
=
data
.
buffer
.
asUint8List
();
final
Image
image
=
decodeImage
(
bytes
);
ticket
.
image
(
image
);
// Print image using a
n alternative (obsolette) command
// Print image using a
lternative commands
// ticket.imageRaster(image);
// ticket.imageRaster(image, imageFn: PosImageFn.graphics);
// Print barcode
final
List
<
int
>
barData
=
[
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
,
0
,
4
];
...
...
example/discover_printers/pubspec.yaml
View file @
7edeea6a
...
...
@@ -15,7 +15,9 @@ dependencies:
image
:
^2.1.4
esc_pos_printer
:
path
:
../../
esc_pos_utils
:
^0.3.1
esc_pos_utils
:
^0.3.2
# esc_pos_utils:
# path: ../../../esc_pos_utils
dev_dependencies
:
flutter_test
:
...
...
example/example.dart
View file @
7edeea6a
...
...
@@ -65,8 +65,9 @@ Future<Ticket> testTicket() async {
// final Uint8List bytes = data.buffer.asUint8List();
// final Image image = decodeImage(bytes);
// ticket.image(image);
// Print image using a
n alternative (obsolette) command
// Print image using a
lternative commands
// ticket.imageRaster(image);
// ticket.imageRaster(image, imageFn: PosImageFn.graphics);
// Print barcode
final
List
<
int
>
barData
=
[
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
,
0
,
4
];
...
...
pubspec.yaml
View file @
7edeea6a
name
:
esc_pos_printer
description
:
The library allows to print receipts using an ESC/POS thermal WiFi printer.
version
:
3.1.
1
version
:
3.1.
2
homepage
:
https://github.com/andrey-ushakov/esc_pos_printer
environment
:
...
...
@@ -9,7 +9,7 @@ environment:
dependencies
:
flutter
:
sdk
:
flutter
esc_pos_utils
:
^0.3.
1
esc_pos_utils
:
^0.3.
2
# esc_pos_utils:
# path: ../esc_pos_utils
...
...
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