would it be possible to create feature to include different text than the label says. i.e. label is ABC-123 and I would like to print under the barcode only 123. thx
Custom text #77
Open
opened 2020年06月18日 13:24:08 +02:00 by heiwanokami
·
2 comments
would it be possible to create feature to include different text than the label says. i.e. label is ABC-123 and I would like to print under the barcode only 123. thx
EAN8(label).write(f, {'write_text': False, 'text': "%s\n123. thx" % (label)})
'write_text': False makes it turn off the default text.
'text': "my new text" changes the default text to that new text.
Turn off the default then turn, write your own, including the original label.
EAN8(label).write(f, {'write_text': False, 'text': "%s\n123. thx" % (label)})
`'write_text': False ` makes it turn off the default text.
`'text': "my new text"` changes the default text to that new text.
Turn off the default then turn, write your own, including the original label.
I couldn't get this inline method working. I was able to get @QuickLearner171998 's method to work.
To adapt it to this scenario, it'd look like:
#Put this under the `import` statement but above your code
barcode.default_writer_options['write_text'] = False
barcode.default_writer_options['text'] = "my new text"
I couldn't get this inline method working. I was able to get @QuickLearner171998 's method to work.
To adapt it to this scenario, it'd look like:
```
#Put this under the `import` statement but above your code
barcode.default_writer_options['write_text'] = False
barcode.default_writer_options['text'] = "my new text"
```
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
Labels
Clear labels
inconsistencies in the API between various barcodes or writers
Automatically merge this PR once CI passes.
Further design discussions and PRs are welcome.
things that need to be documented better
waiting for a reply from the reporter
api-inconsistency
inconsistencies in the API between various barcodes or writers
automerge
Automatically merge this PR once CI passes.
bug
contributions welcome
Further design discussions and PRs are welcome.
documentation
things that need to be documented better
duplicate
enhancement
good first issue
invalid
more-information-needed
waiting for a reply from the reporter
question
sync
wontfix
No labels
api-inconsistency
automerge
bug
contributions welcome
documentation
duplicate
enhancement
good first issue
invalid
more-information-needed
question
sync
wontfix
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#77
Loading...
Add table
Add a link
Reference in a new issue
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?