Getting error with barcodes. Might be due to different slashes in paths on linux. Trying.
This commit is contained in:
6
main.py
6
main.py
@@ -107,7 +107,8 @@ async def barcodes(userid: int = Form(...)):
|
||||
barcode = {'CheckIn': 'Check In', 'CheckOut': 'Check Out'}
|
||||
pdf = FPDF()
|
||||
# pdf.add_font('barcode', '', '.\\static\\barcodeFont\\LibreBarcode128-Regular.ttf', uni=True)
|
||||
pdf.add_font('barcode', '', '.\\static\\barcodeFont\\LibreBarcode39-Regular.ttf', uni=True)
|
||||
# pdf.add_font('barcode', '', '.\\static\\barcodeFont\\LibreBarcode39-Regular.ttf', uni=True)
|
||||
pdf.add_font('barcode', '', './static/barcodeFont/LibreBarcode39-Regular.ttf', uni=True)
|
||||
|
||||
pdf.add_page()
|
||||
|
||||
@@ -130,7 +131,8 @@ async def barcodes(userid: int = Form(...)):
|
||||
pdf.ln()
|
||||
|
||||
try:
|
||||
pdf.output(name='.\\static\\barcodes.pdf')
|
||||
# pdf.output(name='.\\static\\barcodes.pdf')
|
||||
pdf.output(name='./static/barcodes.pdf')
|
||||
return {'Barcodes': 'Ready'}
|
||||
except:
|
||||
return {'Barcodes': 'Failed'}
|
||||
|
||||
Reference in New Issue
Block a user