Community mailing list archives

Re: Printing Code128 Barcode !

Apertoso, Jos De Graeve
- 05/20/2016 03:44:09
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 )

We 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, an commandline utility.  Calling zint like this:

def get_barcode(self, value, height=50):
if value is None:
return 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('[02]%s[15]%s[37]%s[10]%s' % (
    ean_case.zfill(14), best_before_reverse, unit_count, lot),

Zint takes care of translating the application identifiers between square brackets to the right FNC1 codes

When using this take care of corse with user input


Jos De Graeve - Apertoso business ICT

Guido Gezellelaan 16 - B-9800 Deinze - Belgium
Direct: +32 9 381 64 51
General:+32 9 381 64 50
Mobile: +32 475 54 68 80
mail/im/skype: - apertoso

2016-05-20 9:02 GMT+02:00 Naresh Soni <>:
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 !

Naresh Soni
Founder and Consultant
Cozy Business Solutions Pvt. Ltd
+91 8866 370537

Post to: