User Tools

Site Tools


python:barcode

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
python:barcode [2016/08/07 23:27] – [Example create Barcode with hubarcode] adminpython:barcode [2016/08/09 00:03] – [Custom options in Encoder] admin
Line 1: Line 1:
 ====== Python Barcode ====== ====== Python Barcode ======
 +refer:
 +  * https://github.com/hudora/huBarcode
 +  * https://sourceforge.net/projects/dmsbarcodegener/
 ===== huBarcode ===== ===== huBarcode =====
 refer: https://github.com/hudora/huBarcode refer: https://github.com/hudora/huBarcode
Line 24: Line 27:
   - Step2: Run it:<code bat>   - Step2: Run it:<code bat>
 python barcode.py 123 python barcode.py 123
 +</code>Not run:<code bat>
 +barcode.py 123
 +</code>Because it generate error:<code>
 +ImportError: No module named Image
 +</code>
 +==== Custom options in Encoder ====
 +Below are default options for Code128Encoder:
 +<code python>
 +self.options.get('show_label', True)
 +self.options.get('ttf_fontsize', default_fontsize)
 +self.options.get('ttf_font')
 +self.options.get('label_border', 0)
 +self.image_height = self.options.get('height') or (self.image_width / 3)
 +self.options.get('bottom_border', 0)
 +</code>
 +Create Custom options:<code python>
 +options['height'] = 25
 +options['ttf_fontsize'] = 8
 +options['bottom_border'] = 2
 </code> </code>
- 
python/barcode.txt · Last modified: 2022/10/29 16:15 by 127.0.0.1