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'}
|
barcode = {'CheckIn': 'Check In', 'CheckOut': 'Check Out'}
|
||||||
pdf = FPDF()
|
pdf = FPDF()
|
||||||
# pdf.add_font('barcode', '', '.\\static\\barcodeFont\\LibreBarcode128-Regular.ttf', uni=True)
|
# 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()
|
pdf.add_page()
|
||||||
|
|
||||||
@@ -130,7 +131,8 @@ async def barcodes(userid: int = Form(...)):
|
|||||||
pdf.ln()
|
pdf.ln()
|
||||||
|
|
||||||
try:
|
try:
|
||||||
pdf.output(name='.\\static\\barcodes.pdf')
|
# pdf.output(name='.\\static\\barcodes.pdf')
|
||||||
|
pdf.output(name='./static/barcodes.pdf')
|
||||||
return {'Barcodes': 'Ready'}
|
return {'Barcodes': 'Ready'}
|
||||||
except:
|
except:
|
||||||
return {'Barcodes': 'Failed'}
|
return {'Barcodes': 'Failed'}
|
||||||
|
|||||||
Reference in New Issue
Block a user