How to remove the text #57

Open
opened 2019-12-09 17:24:34 +01:00 by upriche · 7 comments
upriche commented 2019-12-09 17:24:34 +01:00 (Migrated from github.com)

Hi i would like to know how to remove the text from under the barcodes, to have only the barcode, no text.

Hi i would like to know how to remove the text from under the barcodes, to have only the barcode, no text.
tokt commented 2019-12-10 17:11:52 +01:00 (Migrated from github.com)

Hello! How do you run the command? For example:

  • python-barcode create "123456789000" outfile -b ean
    will generate barcode without any text.
Hello! How do you run the command? For example: - python-barcode create "123456789000" outfile -b ean will generate barcode without any text.
WhyNotHugo commented 2020-02-25 02:11:12 +01:00 (Migrated from github.com)

Ideally, this should be exposed as a flag that both the ImageWriter and SVGWriter expose.

Until I get a change to implement that, as a hack, you can use this writer:

class ImageWitoutTextWriter(ImageWriter):
    def _paint_text(self, xpos, ypos):
        pass
Ideally, this should be exposed as a flag that both the ImageWriter and SVGWriter expose. Until I get a change to implement that, as a hack, you can use this writer: ```python class ImageWitoutTextWriter(ImageWriter): def _paint_text(self, xpos, ypos): pass ```
crowdawg commented 2020-05-05 06:33:10 +02:00 (Migrated from github.com)

Hello, I came across this issue by reading the documentation as well but eventually discovered by looking at the source that there is in fact an option called write_text=True in the base writer options.

You should update your documentation so people know it exists.

Keep up the good work

Hello, I came across this issue by reading the documentation as well but eventually discovered by looking at the source that there is in fact an option called `write_text=True` in the base writer options. You should update your documentation so people know it exists. Keep up the good work
QuickLearner171998 commented 2020-05-23 22:09:10 +02:00 (Migrated from github.com)

Just write these lines before your code

    from barcode.base import Barcode
    Barcode.default_writer_options['write_text'] = False
Just write these lines before your code ``` from barcode.base import Barcode Barcode.default_writer_options['write_text'] = False ```
nabelekt commented 2021-03-18 06:20:04 +01:00 (Migrated from github.com)

It looks like this is a duplicate of #24. @WhyNotHugo, would you accept a PR with the code given there?

It looks like this is a duplicate of #24. @WhyNotHugo, would you accept a PR with the code given there?
NatanBudny commented 2021-07-16 16:28:16 +02:00 (Migrated from github.com)

Ideally, this should be exposed as a flag that both the ImageWriter and SVGWriter expose.

Until I get a change to implement that, as a hack, you can use this writer:

class ImageWitoutTextWriter(ImageWriter):
    def _paint_text(self, xpos, ypos):
        pass

Works for me! God Bless You, I really Thank you!
I look a lot for something like that, you solved it easily. I still don't understand how it works, but it solved my big problem :D

> Ideally, this should be exposed as a flag that both the ImageWriter and SVGWriter expose. > > Until I get a change to implement that, as a hack, you can use this writer: > > ```python > class ImageWitoutTextWriter(ImageWriter): > def _paint_text(self, xpos, ypos): > pass > ``` Works for me! God Bless You, I really Thank you! I look a lot for something like that, **you solved it easily**. I still don't understand how it works, but it solved my big problem :D
NatanBudny commented 2021-07-16 16:35:00 +02:00 (Migrated from github.com)

Pra quem procura algo em português, esse é meu código que gera a imagem sem o texto do código de barras:

from barcode.writer import ImageWriter

class ImageWitoutTextWriter(ImageWriter):
    def _paint_text(self, xpos, ypos):
        pass

ean = barcode.get('ean13', '123456789102', writer=ImageWitoutTextWriter())
filename = ean.save('ean13')
filename
'ean13.png'


Pra quem procura algo em português, esse é meu código que gera a imagem sem o texto do código de barras: ```import barcode from barcode.writer import ImageWriter class ImageWitoutTextWriter(ImageWriter): def _paint_text(self, xpos, ypos): pass ean = barcode.get('ean13', '123456789102', writer=ImageWitoutTextWriter()) filename = ean.save('ean13') filename 'ean13.png'
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
WhyNotHugo/python-barcode#57
No description provided.