Comments (7)
I need that function too
from esc_pos_utils.
@samo92 my suggestion is, you can use pos_printer_manager(git repo) (In pub.dev) package, which is a intergrated solution for usb, bluetooth and network. And its working good.
(Pos printer manager is devleoped with help of utils package).
In some new printers, you might have to use image bit raster option.
from esc_pos_utils.
Same request
from esc_pos_utils.
In order to print via USB, simply write the return as if it were in a file.
Linux:
File('/dev/usb/lp0').writeAsBytes(bytes);
Windows:
File('\\computer-name\share').writeAsBytes(bytes);
I'm using this method to communicate with the printer
Video with the system working like this: https://www.youtube.com/watch?v=NZngrlGkISU
from esc_pos_utils.
Using Flutter usb printer package we can print with ESC pos printer, but problem is its not working good for images as expected, Don't know whether its the problem with esc_pos_utils package or flutter usb printer package.
we can print as follows:
///list connected printers using flutter usb package
static Future<List> getAllUsbDevices() async {
List<Map<String, dynamic>> results = [];
results = await FlutterUsbPrinter.getUSBDeviceList();
return results;
}
///connect to a printer like this
static Future<bool> connectUsbPrinter(
{required String vendorId, required String productId}) async {
bool? returned;
try {
returned = await flutterUsbPrinter.connect(
int.parse(vendorId), int.parse(productId));
log('device connecetd');
} catch (e) {
returned = false;
log(e.toString());
//response = 'Failed to get platform version.';
}
return returned ?? false;
}
///prepare message using this package(esc pos utils)
static Future<List<int>> prepareMessage() async {
final profile = await CapabilityProfile.load();
late final Generator generator;
generator = Generator(PaperSize.mm58, profile);
List<int> bytes = [];
bytes += generator.text('Aa Bb Cc Dd Ee Ff Gg Hh');
bytes += generator.cut(mode: PosCutMode.partial);
return bytes;
}
///print message with help of flutter usb printer package.
static Future<void> doPrint() async {
List<int> list = await prepareMessage();
try {
await flutterUsbPrinter.write(Uint8List.fromList(list));
} catch (e) {
log('catch ' + e.toString());
}
}
from esc_pos_utils.
Hi everyone, I have the same problem too, does anyone have a suggestion regarding this issue? My printer is an Epson TM-T88V, and it only has an USB and ecom port to communicate with my computer.
from esc_pos_utils.
Oh noooo! flutter web is not supported, i make a quick sample to test the repo.
from esc_pos_utils.
Related Issues (20)
- Paper Size HOT 1
- Only one parameter - text or textEncoded HOT 1
- PaperSize Request
- I can't print images HOT 8
- text size
- Please fix for this Err: on Thai and Lao lang HOT 1
- How to monitor printer status?
- Print Tamil Language Text
- what is this error ? RangeError (index): Invalid value: Not in inclusive range 0..9638: 9639
- Add Paper Size 76mm
- Missing package
- Break the words characters to new line. HOT 1
- Can you confirm if there is a problem with accentuation?
- The Urdu tag is for issues relating to displaying user interfaces and managing data in Udru written language.
- Print Text Size issues
- Divergent on epson printers
- How Print Korean Style ?
- Font
- Space between rows not working
- Can not print image
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from esc_pos_utils.