add id to gen med cert

This commit is contained in:
2024-08-20 14:34:29 +02:00
parent 098aabe25c
commit 794257f655
2 changed files with 18 additions and 11 deletions

View File

@@ -1,3 +1,4 @@
from textwrap import wrap
from fastapi import APIRouter, HTTPException, File, UploadFile, Form
from fastapi.responses import FileResponse, JSONResponse
import requests
@@ -28,6 +29,7 @@ class minioDeleteRequest(BaseModel):
class medCertUploud(BaseModel):
app_id: str
fullName: str
id_no: str
docfname: str
busName: str
busAddr: str
@@ -177,13 +179,18 @@ def generateMedCertPDF(requestItem: medCertUploud):
#Body
myCanvas.setFont('Helvetica', 12)
line1 = "This is to certify that " + requestItem.fullName.upper() + " was seen by " + requestItem.docfname.upper() + " on " + requestItem.startDate + "."
line2 = "He/She is unfit to attend work/school from " + requestItem.startDate + " up to and including " + requestItem.endDate + "."
line3 = "He/She will return on " + requestItem.returnDate + "."
body = ""
body += "This is to certify that " + requestItem.fullName.upper() + " (" + requestItem.id_no+ ") was seen by " + requestItem.docfname.upper() + " on " + requestItem.startDate + "."
body += "\nHe/She is unfit to attend work/school from " + requestItem.startDate + " up to and including " + requestItem.endDate + "."
body += "\nHe/She will return on " + requestItem.returnDate + "."
myCanvas.drawString(50, h-250,line1)
myCanvas.drawString(50, h-280,line2)
myCanvas.drawString(50, h-310,line3)
y = 250
for line in wrap(body, 90):
myCanvas.drawString(50, h-y, line)
y += 30
# myCanvas.drawString(50, h-250,line1)
# myCanvas.drawString(50, h-280,line2)
# myCanvas.drawString(50, h-310,line3)
#Signature
myCanvas.drawImage(imageSig, 50, h - 690,100,100)

View File

@@ -66,7 +66,7 @@ endobj
endobj
10 0 obj
<<
/Author (anonymous) /CreationDate (D:20240820103956+00'00') /Creator (ReportLab PDF Library - www.reportlab.com) /Keywords () /ModDate (D:20240820103956+00'00') /Producer (ReportLab PDF Library - www.reportlab.com)
/Author (anonymous) /CreationDate (D:20240820123153+00'00') /Creator (ReportLab PDF Library - www.reportlab.com) /Keywords () /ModDate (D:20240820123153+00'00') /Producer (ReportLab PDF Library - www.reportlab.com)
/Subject (unspecified) /Title (untitled) /Trapped /False
>>
endobj
@@ -77,10 +77,10 @@ endobj
endobj
12 0 obj
<<
/Filter [ /ASCII85Decode /FlateDecode ] /Length 725
/Filter [ /ASCII85Decode /FlateDecode ] /Length 744
>>
stream
Gas2H>u03/'Sc)J/'d72<7c<[f]gq:V?2STUINsSlI]m\,\BV/"M]C\>/2]n--DRFkC&E;3@9:T6,ot.!R;BQ(Bb!IAUuPR5[?[QU;%;VGWXO73<hb^,\8J(?dWuSgA7^O+d*ap22dl^$.fL.\_saCg0gE`^(N,Dd>qtjTH5q)d%,dg8p4e`_h^(>JAbtKU2'IDS_%HXb&ff%[a(2(J]gN4"n`haaT3Ps1#f/[#ar=;:5bi(>rRBLFTZ7oSBg<N*%nE\?"C1L=8-pla`/As!\ln.7,[:a21;WS\9;Ni=@bbgmok*H8I?`aJDc!TXNo"(#/-)_gMiQCCdX\VNCMWqk<,Cp_nmecc9Vo0EC;tXm99b;kbAiHiQ)k4=SNu%+<67d=AC9ACd3Lp=`d=Q4i3p-mnBs9p"^=Yc7:k5D-pKHfUG7lk8&KA4:QgU?$>/PhLQ`9:XH<:*`TRIE-lf8\@fuB1%1bkVLd82bjWpXTPIqkD&X]\StnY0>`oIN?*;GF]4l*7&*eGtS#1^+fD_1]HL4r@[WQ`.L<[UqdEhAdX>WN#r-B<ZT1I#kV'!m\K%BR`[b6Q]%PdF`PAp*,4/E[N':m&lB(A&q-MHiKN:0oCD&T>,mMq.DYh((o3-a90=5]Ln_"6NRIqXtX<:27s1hrkk.ufHdCJ@^-=%-q^/]J5g8kJcd&O$tm4LU6^LkHh93cBcFr%kH.U;.p?rrHCX3e.~>endstream
Gas2H>u03/'Sc)J/']F`e[6DZG'Z$=WMm`BUINr@2lU;jg%)tBFGTnl3GG0>Zr8136h^,ca6+EU_!WDaW(VXk"lgI$6:"`s$o(SfOJq)]5VV'?F\e#`O9eDq9=HAfcg%D*?EXosNPM!:b_Cf:Lo+GHct[DONX9&!R+B*_@*kPV1hb7,K)82aAf/FA1*2"bA1OBH3*W2TR=I&0#PUr0o>8;Udc[9PK"C_B#[)t.lj,pIHbs?[25Y4<E1u^X.Y5e-1mu4.!U;"_fqWk@81oqo(_qksSgQWjf6,W?\q<G2-@gdq1j#n>#tn/=6$`\./1"kr(DH";<+#K1oXkWMPZJdf)Z<An>1IP='^m$+^_oYliV*9Y=9b[$k_CBM'P$);7UA%gO0BU$9\EhWIBr'u/:)t<.GgJ#*p]lKEh*tbD43)dm^4hmU&VUc,3?'7<9q1#GBYq.Jb]Z/3pf0Y9*P&#GI.*^noV=`J6O9CrcAW'Ba_$t's(_MqLB&f6X:_Y<%i[009g<t#/Q9:0A!'[ZDhZsolecd1K=W4Fn9D(l?-AK@%4`\rA*"f%hmbMQe#W0jjfF@dbuopqC_`0(BlXmgGG1R@':1e&,E21#q)A"<Ed3ud8@D_-;@u^6J&Eb\0`!F`aQMsf:hI8H`oJf^!C!#H2\-Cr.!MnP8;hU.DM'pUK.`6dQ!/meg.\MQ%bOVCcGk!Pk=HMiBpVeA*;"(M!o>_e#H3i+4Ia"nf1!c%p!4)5Q~>endstream
endobj
xref
0 13
@@ -100,7 +100,7 @@ xref
trailer
<<
/ID
[<00ce46e2306ec8472bf4c2eac2b557f1><00ce46e2306ec8472bf4c2eac2b557f1>]
[<754aaa07bf5a4b3e2ac9c40895813549><754aaa07bf5a4b3e2ac9c40895813549>]
% ReportLab generated PDF document -- digest (http://www.reportlab.com)
/Info 10 0 R
@@ -108,5 +108,5 @@ trailer
/Size 13
>>
startxref
688251
688270
%%EOF