printing - Print (generate) a code128 barcode (or any image) in millimeters (php) -
printing - Print (generate) a code128 barcode (or any image) in millimeters (php) -
i need generate labels code128 barcodes
in php
. these printed users printer.
i have specific sets of requirements:
narrow bar width should between 0.375mm , 0.5mm
maximum overall barcode width: 115mm
first 8 digits must utilize subset b remaining 20 digits must utilize subset c code must readable @ high speedsi tried several barcode libraries of them don't allow stating minimum bar width in millimeters. able scale narrow bar width in fixed integer increments, , 1 little , 2 big :)
i tried resampling image using gd lib, code becomes unreadable @ high speeds.
should build own code generator? if so, how generate bars in millimeters?
thanks in advance
ok, believe found solution applies not every browser , printer combination, suits me nicely.
i using barodegen php library found @ barcodegen because 1 allowing me specify subset characters , 1 others.
in specific problem, can this:
$setb = '%'.substr($vars->code, 0, 7); $setc = substr($vars->code, 7); $code_array = array(array(code128_b, $setb), array(code128_c, $setc));
and parse $code_array barcode.
now, other problem solved setting point per inch of generated barcode image. called, wrongly think, dpi. right me if i'm mistaken, dpi harware characteristic of printer. can't alter that. ppi on other hand, can change.
in problem had 244px wide image, , needed print in more 95mm. barcodegen allows calling
$drawing->setdpi(64); // think should rename setppi
now, after have 224px image 64ppi, need show in img tag this:
<img style="width: 96.8375mm;" src="interlink_code128_barcode.php?code='.$code128.'" border="0">
the 96.8375mm obtained solving simple equation, if image contains 64 pixels in 1 inch, how much inches occupy 244 pixels? , transform inches mm
i haven't got confirmation barcodes can read @ high speeds, see printouts looking sharp! :d
php printing barcode-printing code128
Comments
Post a Comment