added more barcodes + logo

This commit is contained in:
raven 2023-02-13 20:22:49 +01:00
parent 55aa6c75af
commit 18dfbff231
Signed by: raven
GPG Key ID: 7B8469C2D00594A1
3 changed files with 15 additions and 5 deletions

BIN
binary_kitchen.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

View File

@ -1,9 +1,12 @@
code,drink,filename
133742000000,KitchenTschunk,tschunk
133742000000,KitchenTschunk2cl,tschunk2cl
133742000009,KitchenTschunk4cl,tschunk4cl
133742000001,VirginTschunk,vir_tschunk
133742000002,MoscowMule,moscowmule
133742000003,VirginMoscowMule,vir_moscowmule
133742000007,GinTonic,gintonic
133742000004,Schnaps2cl,schnaps2cl
133742000005,Schnaps4cl,schnaps4cl
133742000006,Likoer2cl,likoer2cl
133742000007,GinTonic,gintonic
133742000010,Likoer4cl,likoer4cl
133742000002,$Dollar$Mule,dollarmule
133742000003,Virgin$Dollar$Mule,vir_dollarmule
133742000008,generic beer,generic_beer

1 code drink filename
2 133742000000 KitchenTschunk KitchenTschunk2cl tschunk tschunk2cl
3 133742000009 KitchenTschunk4cl tschunk4cl
4 133742000001 VirginTschunk vir_tschunk
5 133742000002 133742000007 MoscowMule GinTonic moscowmule gintonic
133742000003 VirginMoscowMule vir_moscowmule
6 133742000004 Schnaps2cl schnaps2cl
7 133742000005 Schnaps4cl schnaps4cl
8 133742000006 Likoer2cl likoer2cl
9 133742000007 133742000010 GinTonic Likoer4cl gintonic likoer4cl
10 133742000002 $Dollar$Mule dollarmule
11 133742000003 Virgin$Dollar$Mule vir_dollarmule
12 133742000008 generic beer generic_beer

View File

@ -13,6 +13,8 @@ pdf = FPDF()
pdf_row = 0
pdf_colum = 0
pdf_logo = 'binary_kitchen.png'
def generate_barcode(filename, content, label):
if not os.path.exists('out'):
os.makedirs('out')
@ -44,6 +46,7 @@ def pdf_add_barcode(imagepath):
y = 10
pdf_row = 0
pdf.add_page()
pdf.image(pdf_logo, x=100, y=265, h=24)
# determine x-position
if pdf_colum == 0:
@ -58,10 +61,14 @@ def pdf_add_barcode(imagepath):
if __name__ == '__main__':
generate_barcode_username('raven\t', 'raven', 'raven')
generate_barcode_username('raven', 'raven\t', 'raven')
generate_barcode_username('voidptrs Geburtstagsfeier', '\tvoidptrs Geburtstagsfeier\t', 'voidptrs Geburtstagsfeier')
pdf.add_page()
pdf.set_font("Arial", size=15)
pdf.image(pdf_logo, x=180, y=7, h=24)
filename = 'drinks.csv'
with open(filename, 'r') as csvfile: