PHP code128 barcode - News: Version 0.61: Stay in code C when 2 digits remaining
[Submit News]
[2 news in archive]
Version 0.61: Stay in code C when 2 digits remaining
Item posted by Thomas Harding <harding> on Sat 10 Nov 2007 01:45:55 PM UTC.
Thanks to Sonia Heimann, who found the bug and
proposed a new algo.
Versions note:
2 new public variables:
* $this->unoptimized to set to true if you
experience problems with "laposte colissimo" barcode;
* $this->nozerofill to disable trailing and leading zeros
(then it's up to you to manage blank zones)
Comments:
| la Poste barcodes, additional information (posted by Sonia Heimann, Mon 12 Nov 2007 10:47:24 AM UTC) |
It seems that for La Poste barcodes you have to encode the 3 first characters with CODEB then the 10 last chars in CODEC
// $cab is like NL NNN NNN NNNN N
So I splitted the cab string in 2 substrings, forcing the parser to process them independantly
$cab = "1J45034500751";
$code = $barcode->output(array($code_b, $code_c));
So the first batch of 3 characters is processed as B code due to the letter in it, and the last batch of 10 digits is processed as C code thanks to the new library version.
I did not need to change $barcode->unoptimized.
Again, thank you for this very useful library ! |


