Added barcode to exported PDF.
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
from reportlab.graphics.barcode import createBarcodeDrawing, createBarcodeImageInMemory
|
||||
from reportlab.graphics.barcode import createBarcodeImageInMemory
|
||||
from reportlab.graphics.shapes import Drawing
|
||||
from reportlab.lib.units import mm
|
||||
|
||||
|
||||
def make_plate_barcode(text:str) -> Drawing:
|
||||
def make_plate_barcode(text:str, width:int=100, height:int=25) -> Drawing:
|
||||
# return createBarcodeDrawing('Code128', value=text, width=200, height=50, humanReadable=True)
|
||||
return createBarcodeImageInMemory('Code128', value=text, width=100*mm, height=25*mm, humanReadable=True, format="png")
|
||||
return createBarcodeImageInMemory('Code128', value=text, width=width*mm, height=height*mm, humanReadable=True, format="png")
|
||||
Reference in New Issue
Block a user