Custom text #77

Open
opened 2020-06-18 13:24:08 +02:00 by heiwanokami · 2 comments
heiwanokami commented 2020-06-18 13:24:08 +02:00 (Migrated from github.com)

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

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
tatarize commented 2020-08-15 19:03:40 +02:00 (Migrated from github.com)

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.
SeaDude commented 2020-12-28 03:20:35 +01:00 (Migrated from github.com)

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 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#77
No description provided.