Comments (10)
You are right @kmlpandey77
I tried what you have in your initial comment and any Text that is added gets printed on the same label.
( Initially test on the left hand side. )
I wrote a flushCommands()
method that empties the $command
array. So you are able to do something like this.
$labels = ['Bart', 'Lisa', 'Maggie'];
foreach ($labels as $label) {
$printer->addCommand(new Command\Text( $label ));
$printer->printLabel();
$printer->flushCommands();
}
Which resulted in the labels on the right hand side of my image.
I'm sure @RamyTalal has a better solution for us than my flushCommands()
method?
from label-printer.
I think it's nicer to flush in the printLabel()
method.
from label-printer.
That's even better!
from label-printer.
Thank you @ntaylor-86,
I dont get flushCommands()
method.
but I get a solution for now, (Using dash [------])
$printer->addCommand(new Command\Text("Order No: " . $sale->getOrderNumber() . "\n"));
foreach ($sale->items as $item) { //$sale->item is food list
for ($i=0; $item->qty > $i; $i++) {
$printer->addCommand(new Command\Text("----------------\n")); // love to use CUT::HALF or CUT:: CNAIN instead of dash [-----]
$printer->addCommand(new Command\Text($item->item_title . "\n"));
}
}
$printer->printLabel();
from label-printer.
@kmlpandey77 from your photo, is your end goal is to have 6 different labels?
from label-printer.
I have use QL-810w, but "CUT " Function does not work. It's cut at last.
$printer->addCommand(new Command\Text('Hallo')); $printer->addCommand(new Command\Cut(Command\Cut::FULL)); $printer->addCommand(new Command\Text('Hallo 2')); $printer->addCommand(new Command\Cut(Command\Cut::FULL));
@RamyTalal is the Cut command meant to work how @kmlpandey77 has implemented there?
Does that work on your printer? Thanks.
from label-printer.
@ntaylor-86 That works.
from label-printer.
flushCommands
@ntaylor-86 can you share the content of your flushCommands ?
from label-printer.
flushCommands
@ntaylor-86 can you share the content of your flushCommands ?
LoL. It's been two and a half years since I looked at this. I don't remember off the top of my head, but when I get a second I'll check it out.
from label-printer.
You can see the command implemented in this commit: ntaylor-86@838973b
from label-printer.
Related Issues (20)
- Class Command\ObjectCommand not found HOT 6
- can add pdf file ? HOT 1
- How to set character to danish (æøΓ₯) HOT 1
- Issue in php 7.4 with protected variable Object HOT 1
- QL-720NW: disable auto cut HOT 4
- Landscape mode HOT 5
- Compability QL-1110NWB HOT 1
- Template mode image support HOT 1
- Template mode does not print bold HOT 3
- Barcode 128 implementation
- I can't print barcode with QL810W HOT 1
- Qr Size HOT 1
- Security question HOT 5
- Special characters HOT 3
- Print Image HOT 4
- Change orientation HOT 3
- Using Tables HOT 1
- Cyrillic? HOT 1
- How to connect this library use printer Brother with USB and php ? HOT 1
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 label-printer.