Files
library/test.py

46 lines
1.2 KiB
Python

# from isbnlib import meta
# isbn = '9780747532743'
# infowiki = meta(isbn, service='wiki')
# infoopenl = meta(isbn, service='openl')
# print(infowiki)
# print(infoopenl)
from fpdf import FPDF
code = 'Location:1'
test = {'CheckIn': 'Check In', 'CheckOut': 'Check Out', 'test': 'testing'}
pdf = FPDF()
pdf.add_font('barcode', '', '.\\static\\barcodeFont\\LibreBarcode128-Regular.ttf', uni=True)
pdf.add_page()
for each in test:
pdf.set_font('barcode', '', 25)
pdf.cell(0, 5, each)
w = pdf.get_string_width(each)
pdf.ln()
pdf.set_font('Arial', '', 5)
pdf.cell(w, 5, test[each], align='C')
pdf.ln()
pdf.ln()
#
# pdf.set_font('barcode', size = 24)
# pdf.cell(0,10,txt="CheckIn", ln=2, align='C')
#
# pdf.set_font('Arial', size = 3)
# pdf.cell(0,1,txt="Check In", ln=1, align='C')
#
# pdf.set_font('barcode', size = 24)
# pdf.cell(0,10,txt="CheckOut", ln=2, align='C')
#
# pdf.set_font('Arial', size = 3)
# pdf.cell(0,1,txt="Check Out", ln=1, align='C')
#
# pdf.set_font('barcode', size = 24)
# pdf.cell(0,10,txt="Location:1", ln=2, align='C')
#
# pdf.set_font('Arial', size = 3)
# pdf.cell(0,1,txt="Location: 1", ln=1, align='C')
pdf.output(name='.\\static\\barcodes.pdf')