Remove text below barcode in python barcode.py library

前端 未结 4 1099
星月不相逢
星月不相逢 2021-01-27 05:17

Does anyone know how to remove text below a bar-code? Bar-code is generated using barcode.py library. I was trying to check in https://bitbucket.org/whitie/python-b

相关标签:
4条回答
  • 2021-01-27 05:34

    If you import "barcode", the solution is:

    import barcode
    barcode.base.Barcode.default_writer_options['write_text'] = False
    
    0 讨论(0)
  • 2021-01-27 05:40

    try this: barcode.default_writer_options['write_text'] = False

    0 讨论(0)
  • 2021-01-27 05:41

    Looking at the code, it appears you can set the attribute 'human' (human-readable text) to a non-empty string to override the text at the bottom. If this is set to a string with a single blank, ' ', the text will be empty.

    0 讨论(0)
  • 2021-01-27 05:48

    This is the solution

    import barcode
    from barcode.writer import ImageWriter
    ITF = barcode.get_barcode_class('itf')
    itf = ITF('30573190692203003169482900832115201911297', writer=ImageWriter())
    fullname = itf.save('itf_barcode', options={"write_text": False})
    
    0 讨论(0)
提交回复
热议问题