ramytalal / label-printer Goto Github PK
View Code? Open in Web Editor NEWEasily print labels with a Brother label printer.
License: MIT License
Easily print labels with a Brother label printer.
License: MIT License
Hi are you any closer to being able to use a table for data in the template more, or does some on have a diffent solution
I get the following error running the example script to print the template with some variables:
Fatal error: Cannot use 'Object' as class name as it is reserved in /vendor/ramytalal/label-printer/src/Command/Object.php
This is because the class Object is a reserved keyword in PHP 7.2 and above. So my suggestion is to rename this class to another one.
Hi, I'm trying to print barcodes but allways have the same, a commands string, For example I got "itrhwzBCA04220007510" trying to print CA04220007510 barcode with code128.
$stream = stream_socket_client('tcp://'.$printer_ip.':9100', $errorNumber, $errorString);
$printer = new Printer(new Template(2, $stream));
$printer->addCommand(new Command\Barcode($product->reference, 29, Command\Barcode::WIDTH_MEDIUM, 'CODE39', true, 2.5));
$printer->printLabel();
fclose($stream);
Whats happend? Ineed to do something more?
Thanks
Is there any way to support special characters? I tried with template
$stream = stream_socket_client('tcp://10.0.0.16:9100', $errorNumber, $errorString);
$printer = new Printer(new Template(3, $stream));
$printer->addCommand(new Command\ObjectCommand('address', 'ěščřžýáíééĚŠČŘŽÝÁÍÍÉ'));
$printer->printLabel();
The printed label is with wrong encoded characters.
how to print text with images (eg barcode)?
Hi everyone, i try to print qr code but size is to small any body can help me?
i've trying read brother manual https://download.brother.com/welcome/docp100367/cv_ql1100_1110_eng_escp_100.pdf#page=78
but still can't enlarge size of qr code.
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 there an option for a landscape mode? Thanks!
I'm working on a (partial, for now) implementation of barcode printing based on your other function implementations,, but it's not actually printing a barcode when I try to use it. Any chance you could look it over and see what I might be missing?
In my PHP page that prints the label, this is the line I use to write the barcode:
$printer->addCommand(new Command\BarCode($detailID,48,Command\BarCode::WIDTH_MEDIUM,"code39",false,2.5));
Hi, does the objectCommand support images or is it just text? Thanks!
Hi,
I want to print image to label printer, may I know is this library support? I try to use objectCommand but not successful, or any method I can modify it?
Just did a fresh install with Composer
$ composer require RamyTalal/Label-Printer
And followed the Template instruction on the README.md
And that results in the error Class Command\ObjectCommand not found
Looking at the commit history Object.php
was renamed to ObjectCommand.php
- f6150f1
To fix this issue I had to rename Object.php
to ObjectCommand.php
and changed the class name to ObjectCommand
After doing that this package worked a treat! 🎉
Is composer pulling down an old version?
Thanks for this package @RamyTalal
I need to turn off auto cut on my QL-720NW when I print a series of labels.
I have tried with FULL, HALF, CHAIN and SPECIAL but none of them have worked.
Is there a way I can turn auto cutting off?
This is fuction working? If I change CODE39 by CODE128 or other function, don’t print barcode.
How to select particular printer on network ?
I'm testing on Brother QL 570 printer
what should i do if i connect the printer to a USB port.
What should i put in this line:
$stream = stream_socket_client('tcp://192.168.1.8:9100', $errorNumber, $errorString);
I try to use example:
$stream = stream_socket_client("'tcp://192.168.1.8:9100", $errno, $errstr);
But I got error:
Warning: stream_socket_client(): php_network_getaddresses: getaddrinfo failed
Warning: stream_socket_client(): unable to connect to 'tcp://192.168.1.8:9100 (php_network_getaddresses: getaddrinfo failed)
How can I fix it? Thanks.
I am trying to connect to a remote printer using your library. However, I am having issues in configuration the library. I followed the steps the according the readme file.
Fatal error: Class 'Talal\LabelPrinter\Printer' not found in /Applications/AMPPS/www/test-lol/test.php on line 9
Can you please help me what I have to do in order to resolve the issue?
Hi,
I need to change character set to Danish so I can print æøå. i have tried with utf8 encode etc but nothing that it helps.
Can anyone tell me how I can change it? i have looked in the files but did not find a place where it can be set.
I have a brother QL-720NW
I found this in the documentation for ESC/P:
do you have insert pdf function or html code?
Hi. Im using template mode. In the template text is set to Arial in semibold. When printing through this library using network printer it does not come out in semibold. If I print using the P-touch program, it does come out in semibold.
Printer: Brother QL-820NWB
Code:
$this->printer = new Printer(new Template($template, $this->stream));
$this->printer->addCommand(new Command\ObjectCommand('productName', utf8_decode($this->product->name)));
$this->printer->addCommand(new Command\ObjectCommand("barcode", $this->product->id));
$this->printer->addCommand(new Command\ObjectCommand("price", "{$product->price_with_mva},-"));
$this->printer->addCommand(new Command\Cut(Command\Cut::FULL));
$this->printer->printLabel();
Template files I have tested with:
Templates.zip
is there a way to connect usb using this code
$stream = stream_socket_client('tcp://192.168.1.8:9100', $errorNumber, $errorString);
or replace that code
Hey this is a great pacakge ive been playing with it, is there anyway to change the orientation of the print so its landscapes and we can add lines, also I see images have been highly requested any news on that :D
To make this wonderful script working the src have to be edited and the "Object" in Command.php has to be renamed.
in my case im lazy and named it to Objekt.
The the script runs well with php 7.4
Hello,
how to print Cyrillic? I am receiving strange symbols when printing.
Greetings
If I send potentially sensitive information (i.e. name, email) to the printer across the internet, is the raw data unencrypted/plain text? So if someone intercepted it, would they be able to access the information?
Is there an option to encrypt the data? Any advise would be much appreciated. Thanks!
I would just like to report that I have tested with Brother QL-1110NWB and it works.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.