You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, i cant seem to find a way to increase the barcodetext size. Mine is pretty small now and needs to be bigger. can someone help?
import labels
from reportlab.graphics import shapes
from barcode import Code39
from barcode.writer import ImageWriter
import os
#Create Label Format(mm)
height = 100
width = 50
specs = labels.Specification(height, width, 1, 1, height, width)
#Draw Label
def draw_label(label, width, height, obj):
# Just convert the object to a string and print this at the bottom left of
# the label.
label.add(shapes.Image(80, 25, width=200, height=100, path=obj))
# Create the sheet.
sheet = labels.Sheet(specs, draw_label, border=False)
#User Input
lager = int(input("Bitte das Lager angeben(z.b. 1-8):"))
regal = int(input("Bitte die Regal Nummer angeben(z.b. 10-80):"))
platz = int(input("Bitte die Platz Anzahl angeben(z.b. 0-30):"))
ebene = int(input("Bitte die Ebenen Anzahl angeben(z.b. 0-5):"))
# Add a couple of labels.
labelc = 0
ebenec = 0
platzc = 0
while True:
barcode = f"{lager}{regal:02d}{platzc:02d}{ebenec}"
barcodetext = f"{regal:02d}-{platzc:02d}-{ebenec:02d}"
barcode39 = Code39(barcode, writer=ImageWriter(), add_checksum=False)
barcode39.save(f"./temp/{lager}{regal:02d}{platzc:02d}{ebenec}", text=barcodetext)
sheet.add_label(f"./temp/{lager}{regal:02d}{platzc:02d}{ebenec}.png")
#os.remove(f"./temp/{lager}{regal:02d}{platzc:02d}{ebenec}.png")
labelc += 1
platzc += 1
if platzc > platz:
platzc = 1
ebenec += 1
if ebenec > ebene:
break
# Save the file and we are done.
sheet.save(f'Lager-{lager}_Regal-{regal}.pdf')
for file in os.listdir("./temp"):
if file.endswith(".png"):
os.remove(f"./temp/{file}")
print("{0:d} label(s) output on {1:d} page(s).".format(sheet.label_count, sheet.page_count))
The text was updated successfully, but these errors were encountered:
Hello, i cant seem to find a way to increase the barcodetext size. Mine is pretty small now and needs to be bigger. can someone help?
The text was updated successfully, but these errors were encountered: