Label-Printer
Label-Printer copied to clipboard
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
Hi @IvanPagan,
When using templates. You add the object you want to manipulate in your template and give it a unique Object Name
in the P-touch Editor software.
Then you can use the ObjectCommand
interface like so to change the values in your template,
$printer = new Printer(new Template(5, $stream)); // Template #5 stored on the printer
$printer->addCommand(new Command\ObjectCommand('barcode', "123456"));
$printer->addCommand(new Command\ObjectCommand('text', "IvanPagan"));
$printer->printLabel();