Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

barcode and write_text sind same origin leads to incomplete data #43

Open
LeChatNoire93 opened this issue Oct 11, 2023 · 1 comment
Open

Comments

@LeChatNoire93
Copy link

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()

@cod3monk
Copy link
Owner

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()

@cod3monk cod3monk changed the title QR-Code not showing the complete text -> Issue 41 barcode and write_text sind same origin leads to incomplete data Oct 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants