1
0
Fork
You've already forked python-barcode
0

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)
Copy link

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)
Copy link

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)
Copy link

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)
Copy link

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)
Copy link

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)
Copy link

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)
Copy link

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)
Copy link

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 Branch/Tag specified
main
pre-commit-ci-update-config
extensibility
fix_sizes
feature/longer_guard_bar
ean-without-checksum
readme-formatting
cleaning
cleanup
srolin/master
michieldwitte/left-alignment-fix
v0.13.1
v0.13.0
v0.12.0
v0.11.0
v0.10.0
v0.9.0
v0.8.3
v0.8.2
v0.8.1
v0.8.0
0.8beta1
0.7
0.7beta4
0.7beta3
0.7beta2
v0.6
v0.6b3
v0.6b2
v0.6b1
v0.5.0
v0.5.0b1
v0.4.3
v0.4.2
v0.4.1
v0.4
v0.4b2
v0.4b1
v0.3
v0.3b1
v0.2.1
v0.1
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
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
Reference in a new issue
WhyNotHugo/python-barcode
No description provided.
Delete branch "%!s()"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?