barcode and write_text sind same origin leads to incomplete data
LeChatNoire93 opened this issue · 1 comments
I followed the advice to use the barcode() function. In my code using the barcode function makes no difference. The first the characters are cut off.
def create_zebra_qr_code_special(code_to_print) :
# label = zpl.Label(50,20,300)
# height = 15
# label.origin(10, height)
# label.write_barcode(height = 20, barcode_type= 'U', check_digit='Y')
# label.write_text(code_to_print)
# label.endorigin()
# code = label.preview()
# print(code)
l = Label(50,20,12) #12 -> 300dpi
#code_to_print = '000'+code_to_print #Die ersten 3 Zeichen werden verschluckt
code_to_print =code_to_print # Die ersten 3 Zeichen werden verschluckt
height =5 #Ausrichtung Oben,Unten -> Größere Zahl = weiter unten
l.origin(5, height,justification='2')
#Mögliche Label Typen, U,C,E,X,Q,2A,3
#Q= QR-Code, C = Barcode, E = anderer Barcode
#l.barcode('C', code_to_print, height=100,check_digit='Y') # height höhe des Barcodes in keine Ahnung welcher Einheit, Strichcode
l.barcode('Q',code_to_print,height=None, check_digit='Y', magnification='5') #height höhe des Barcodes in keine Ahnung welcher Einheit
l.write_text(code_to_print)
l.endorigin()
#l.preview() #Debugging, Anzeige des labels
return l.dumpZPL()
Apparently barcode
(any type) and write_text
does not work in the same origin. Not sure why, but the following will work:
import zpl
l = zpl.Label(50,20,12)
code_to_print="code_to_print"
height=5
l.origin(5, height,justification='2')
l.barcode('Q',code_to_print,height=None, check_digit='Y', magnification='5')
l.endorigin()
l.origin(5, height+12,justification='2')
l.write_text(code_to_print)
l.endorigin()
l.preview()