Comments (10)
@amirulasrof try with this: https://gist.github.com/DavBfr/bbe8ba482b1a9101628d8b0d83888517
If it works correctly, it should be easy to make a nice coupon using https://pub.dev/packages/pdf.
from esc_pos_printer.
CODE 39 is implemented in pdf version 1.3.28:
BarcodeWidget(
data: 'HELLO 123',
width: 200,
height: 50,
);
If you need to rotate it, wrap it with Transform.rotateBox:
Transform.rotateBox(
angle: pi / 2,
child: BarcodeWidget(
data: 'HELLO 123',
width: 200,
height: 50,
),
);
from esc_pos_printer.
Thank you @DavBfr I will definitely try this. Looks promising.
from esc_pos_printer.
Hi @DavBfr I try your code and encountered several error.
This is my pubspec : https://gist.github.com/amirulasrof/655099e425e559b70a8c3c344c956952
Below is the error :
Compiler message:
lib/main.dart:71:1: Error: This requires the 'extension-methods' experiment to be enabled.
Try enabling this experiment by adding it to the command line when compiling and running.
extension PdfRasterExt on PdfRaster {
^^^^^^^^^
lib/main.dart:71:27: Error: A function declaration needs an explicit list of parameters.
Try adding a parameter list to the function declaration.
extension PdfRasterExt on PdfRaster {
^^^^^^^^^
lib/main.dart:71:1: Error: Type 'extension' not found.
extension PdfRasterExt on PdfRaster {
^^^^^^^^^
lib/main.dart:71:24: Error: Type 'on' not found.
extension PdfRasterExt on PdfRaster {
^^
lib/main.dart:71:1: Error: 'extension' isn't a type.
extension PdfRasterExt on PdfRaster {
^^^^^^^^^
lib/main.dart:73:31: Error: Getter not found: 'width'.
return im.Image.fromBytes(width, height, pixels);
^^^^^
lib/main.dart:73:38: Error: Getter not found: 'height'.
return im.Image.fromBytes(width, height, pixels);
^^^^^^
lib/main.dart:73:46: Error: Getter not found: 'pixels'.
return im.Image.fromBytes(width, height, pixels);
^^^^^^
lib/main.dart:171:37: Error: Method not found: 'Printing.raster'.
await for (var page in Printing.raster(_buildDocument(), dpi: 300)) {
^^^^^^
lib/main.dart:172:18: Error: Method not found: 'PdfRasterImage'.
images.add(PdfRasterImage(page));
^^^^^^^^^^^^^^
lib/main.dart:172:18: Error: The method 'PdfRasterImage' isn't defined for the class '_MyAppState'.
- '_MyAppState' is from 'package:scsgoprint/main.dart' ('lib/main.dart').
Try correcting the name to the name of an existing method, or defining a method named 'PdfRasterImage'.
images.add(PdfRasterImage(page));
^^^^^^^^^^^^^^
lib/main.dart:180:37: Error: Method not found: 'Printing.raster'.
await for (var page in Printing.raster(_buildDocument(), dpi: printerDpi)) {
from esc_pos_printer.
In your pubspec, you missed:
environment:
sdk: ">=2.7.0 <3.0.0"
This code uses extension methods from Dart 2.7
from esc_pos_printer.
Its working now, thank you @DavBfr for the help.
from esc_pos_printer.
Hi @DavBfr how to render barcode using plugin like https://pub.dev/packages/barcode_flutter in the pdf. Is it possible ?
from esc_pos_printer.
Not yet, what type of barcode do you need?
from esc_pos_printer.
Any type will be good for now.
from esc_pos_printer.
Very nice, thank you for the help @DavBfr
from esc_pos_printer.
Related Issues (20)
- Please update image plugin to ^4.0.0
- How to use Thermal printer in flutter Web HOT 1
- No option to pass COLOR CODE in style HOT 1
- can't print a long image HOT 2
- Socket has not been initialized when calling rawBytes method
- Line spacing using the ESC 3 <n> command
- Please update image plugin to ^4.0.0 HOT 2
- can you update example ? wifi has depecrated
- [ binding] Print result: Error. Printer connection timeout
- it will also work with Android POS Machine?
- FYI: esc_pos_dart
- issues after flutter upgrade to last. HOT 1
- Issue in install pakage.
- Image printing problem is slow on real device
- lineThrough
- Star Micronics SP700 / SP742 - Ethernet (Column spacing)
- Can we print Marathi language text using esc_pos_printer HOT 1
- The lower bound of "sdk: '>=2.7.0 <3.0.0'" must be 2.12.0 or higher to enable null safety.
- How to monitor printer status? HOT 1
- hr()
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_printer.