diff --git a/kitchen_counter/lpp/certificate/certificate.pdf b/kitchen_counter/lpp/certificate/certificate.pdf index 94d7daf..6fa1ca7 100644 Binary files a/kitchen_counter/lpp/certificate/certificate.pdf and b/kitchen_counter/lpp/certificate/certificate.pdf differ diff --git a/kitchen_counter/lpp/certificate/createCertificate.py b/kitchen_counter/lpp/certificate/createCertificate.py index a0d928f..8400497 100755 --- a/kitchen_counter/lpp/certificate/createCertificate.py +++ b/kitchen_counter/lpp/certificate/createCertificate.py @@ -15,9 +15,10 @@ basepath = BasePath() # from .utils import render_to_pdf -def certificateGenrate(name,file_from,Hash,projectname="NAN",matic=0): +def certificateGenrate(name,file_from,Hash,projectname="NAN",matic="0"): main = Certificate.objects.filter(user_name="MyNextFilm") - + matic = int(matic) + matic = matic/10**18 if main: main1 = Certificate.objects.get(user_name="MyNextFilm") ids = main1.id # blockchain_obj = UserCredentialsForBlockchain.objects.get(user=request.user) @@ -36,22 +37,24 @@ def certificateGenrate(name,file_from,Hash,projectname="NAN",matic=0): "date": date.today(), "hash": Hash, "id": ids, - 'Matic':matic, + 'Matic':"{:.4f}".format(matic), 'File_name':projectname, + "basepath":basepath, } template = get_template( f'{basepath}/lpp/templates/lpp/blockchainCertificate.html') html = template.render(context) options = { - 'page-size': 'A4', + 'page-size': 'A5', + 'zoom': 3.5, 'margin-top': '0.0in', 'margin-right': '0.0in', 'margin-bottom': '0.0in', 'margin-left': '0.0in', - 'enable-local-file-access': '' + 'enable-local-file-access': '', } pdfkit.from_string( - html, f'{basepath}/lpp/certificate/certificate.pdf', options=options,verbose=True) + html, f'{basepath}/lpp/certificate/certificate.pdf', options=options) return f'{basepath}/lpp/certificate/certificate.pdf' # certificateGenrate("pravesh yadav","PPT Conversiom", "qwefgfdsdfgdsdcvxs")