remove text under barcode in python

how to remove text under barcode @ python-barcode library

by

in

You should set `options` parameter on barcode.save object with {“writer_text”: False}

basically it should look like: barcode.save(“barcode_file_name”, options={“writer_text”: False}).
You can pass multiple options at once, example:

import barcode
import io
from base64 import b64encode
from barcode.writer import ImageWriter


# Generate barcode object
barcode_obj = barcode.Code128(str("12363296"), writer=barcode.writer.ImageWriter())


writer_options = {
        "write_text": False,  # Disable writing text under the barcode
        "background": "white",
        "foreground": "black",
        "module_width": 0.3,
        "module_height": 15,
    }

#save as an image:
barcode_obj.save("barcodeeeeee", options=writer_options)

 


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *