Comments (9)
Just write these lines before your code
from barcode.base import Barcode
Barcode.default_writer_options['write_text'] = False
from python-barcode.
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
from python-barcode.
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
from python-barcode.
Hello! How do you run the command? For example:
- python-barcode create "123456789000" outfile -b ean
will generate barcode without any text.
from python-barcode.
It looks like this is a duplicate of #24. @WhyNotHugo, would you accept a PR with the code given there?
from python-barcode.
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
from python-barcode.
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'
from python-barcode.
from barcode.base import Barcode Barcode.default_writer_options['write_text'] = False
its works
from python-barcode.
Closing as dupe of #24. PRs welcome.
from python-barcode.
Related Issues (20)
- How to use with Pillow image
- ISBN-13 starting with 979 HOT 1
- Text placement in ImageWriter HOT 2
- UPC/UPCA final output doesn't include guard bars HOT 1
- Add some form of tests reading the barcodes
- no support for MSI (Plessey) barcodes HOT 2
- EAN13 calculate_checksum() generates inconsistent values HOT 6
- better formating for GS1_128 HOT 1
- Unable to generate PNG using pillow 10 HOT 3
- dpi HOT 1
- generating barcode error HOT 1
- Unexpected ">" symbol at the end of generated EAN-13 barcode HOT 2
- module_width not working HOT 1
- invalid ppem value with 0.15.1 but not with 0.14.0 HOT 5
- Incompatibility with pillow 10.0.1 HOT 10
- Error on the number generated HOT 11
- Redable text under bars is cut out from the image HOT 2
- Support for Code128 FNC4 / ISO-8859-1
- Why does `Barcode.build()` always return a singleton list? HOT 2
- GS1-128 images are cut-off HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from python-barcode.