Community mailing list archives
Re: Printing Code128 Barcode !by
Thanks a lot.
On 20 May 2016 at 13:17, Jos De Graeve <firstname.lastname@example.org> wrote:
Hi Naresh,We have done a project needing GS1-128 barcodes for shipping labels. ( note that GS1-128 is based on ean-128 but defines some extra stuff ) https://en.wikipedia.org/wiki/GS1-128We have found it particularly hard to encode the so called "Application Identifiers" such as FNC-1 etc. These identifiers are not encoded in ascii and a lot of barcode tools choke on that.We created the report with aeroo reports and ended up generating the GS1-128 barcodes with https://zint.github.io/, an commandline utility. Calling zint like this:@api.model
def get_barcode(self, value, height=50):
if value is None:
zint_args = [
'/usr/bin/zint', # the executable
'--barcode=16', # 16: GS1-128
'--height=%s' % height, # Height of symbol in multiples of x-dimension.
'--scale=2', # Adjust size of output image. ( more pixels )
'--whitesp=5', # Width of whitespace in multiples of x-dimension.
'--directpng', # output png data on stdout
'--data=%s' % value # data barcode
data = b64encode(subprocess.check_output(zint_args))
return data.... return self.get_barcode('%s%s%s%s' % ( ean_case.zfill(14), best_before_reverse, unit_count, lot), height=height)Zint takes care of translating the application identifiers between square brackets to the right FNC1 codesWhen using this take care of corse with user inputRegards,2016-05-20 9:02 GMT+02:00 Naresh Soni <email@example.com>:Hi Community,Has anyone ever passed through the issue in odoo 8.0 when printing code128 barcode which has such a big string 200010101-0001-THD-01-S-BLK-100001 Odoo prints it but when scanned through the scanner the scanner doesn't recognize it nor its decoded using online tools.Any Idea !Thanks,