Closed longsview closed 8 years ago
This PR fixes the long barcode issue: https://github.com/mike42/escpos-php/pull/114
But there is still an issue using the CODE128 on this printer.
Hi,
Thanks for submitting the width-setting snippet.
I tried to replicate, but found a numeric CODE128 code in the barcode.php example. There is some extra complexity around each type of barcode- in your case, you need to inject {A
, {B
, or {C
at the start of the data to specify the CODE128 encoding.
It would be good to have a series of wrappers which neaten this interface, but in the meantime, you can probably adapt this snippet for your use case.
Sample data
012323392982
<?php
require __DIR__ . '/../../autoload.php';
use Mike42\Escpos\Printer;
use Mike42\Escpos\PrintConnectors\FilePrintConnector;
$a = "{A012323392982";
$b = "{B012323392982";
$c = "{C" . chr(01) . chr(23) . chr(23) . chr(39) . chr(29) . chr(82);
$connector = new FilePrintConnector("php://stdout");
$printer = new Printer($connector);
$printer -> setJustification(Printer::JUSTIFY_CENTER);
$printer -> setBarcodeHeight(48);
$printer->setBarcodeTextPosition(Printer::BARCODE_TEXT_BELOW);
foreach(array($a, $b, $c) as $item) {
$printer -> barcode($item, Printer::BARCODE_CODE128);
$printer -> feed(1);
}
$printer -> cut();
$printer -> close();
Output:
To test that your output scans correctly, pick up a copy of zxing/zxing.
Hey there, Using a TM-T88V connected via USB and having some issues.
First off the BARCODE_CODE128 does not print to this machine. Looks like it is not passing the regex but it is an all numeric code (012323392982).
Second since the code is long it doesn't print the barcode at all. I am guessing because it goes off the width of the page. Is there anyway to get this barcode to print. I've tried CODE39 and it does pass the regex but suffers from the second issue here.
Thanks.