GithubHelp home page GithubHelp logo

ramytalal / label-printer Goto Github PK

View Code? Open in Web Editor NEW
61.0 61.0 22.0 104 KB

Easily print labels with a Brother label printer.

License: MIT License

PHP 100.00%
brother-label-printer composer label-printer php

label-printer's People

Contributors

arienclaij avatar cschlipp avatar dependabot[bot] avatar ntaylor-86 avatar ramytalal avatar xelan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

label-printer's Issues

Using Tables

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 can't print barcode with QL810W

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

Special characters

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.

Does not work "Cut" on QL 810w

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));

Barcode implementation

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?

BarCode.php.txt

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));

Print Image

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?

Class Command\ObjectCommand not found

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

QL-720NW: disable auto cut

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?

Selecting printer

How to select particular printer on network ?

I'm testing on Brother QL 570 printer

usb 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);

stream_socket_client() open with fail

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.

Fatal error: Class 'Talal\LabelPrinter\Printer' not found

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?

How to set character to danish (æøå)

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:

231020_MJ-DESKTOP_ca8661c0-2758-49e0-9284-a09ffce376d6

Template mode does not print bold

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

Change orientation

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

Issue in php 7.4 with protected variable Object

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

Cyrillic?

Hello,
how to print Cyrillic? I am receiving strange symbols when printing.

Greetings

Security question

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!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.