|
|
|
@ -230,7 +230,7 @@ def get_base_url(request): |
|
|
|
return "{0}://{1}".format(protocol, current_domain) |
|
|
|
|
|
|
|
|
|
|
|
def create_barcode(value): |
|
|
|
def create_barcode(value, width=170, height=50): |
|
|
|
''' |
|
|
|
creates a base64 encoded barcode PNG image |
|
|
|
''' |
|
|
|
@ -239,8 +239,8 @@ def create_barcode(value): |
|
|
|
value_bytes = bytes(value, "ascii") |
|
|
|
barcode = createBarcodeDrawing('Code128', |
|
|
|
value=value_bytes, |
|
|
|
barWidth=170, |
|
|
|
height=50, |
|
|
|
barWidth=width, |
|
|
|
height=height, |
|
|
|
fontSize=2, |
|
|
|
humanReadable=True) |
|
|
|
data = b64encode(barcode.asString('png')) |
|
|
|
|