Merge branch 'ps' into 'master'

update 解决证书企业名称不居中的问题

See merge request root/tfse_rating!24
This commit is contained in:
王思川 2022-01-24 07:06:51 +00:00
commit a38ee3d793
1 changed files with 3 additions and 2 deletions

View File

@ -24,7 +24,8 @@ class CertificateGenerator:
def gen_text(self):
self.doc.setFont('SourceHanSerifCN-Bold', 20)
self.doc.drawString(2.9 * inch, 450, self.text_data['企业名称'])
margin = (Width - len(self.text_data['企业名称']) * 19) / 2
self.doc.drawString(margin, 450, self.text_data['企业名称'])
self.doc.setFont('SIMSUN', 12, leading=5)
self.doc.drawString(2.8 * inch, 433, '统一社会信用代码:{}'.format(self.text_data['统一社会信用代码']))
self.doc.setFont('SourceHanSerifCN-Bold', 35)
@ -48,7 +49,7 @@ if __name__ == '__main__':
"企业名称": "远东资信评估有限公司",
"统一社会信用代码": "91310101132508092K",
"企业级别": "AA",
"证书编号": "FECR2022010100000001",
"证书编号": "CCRE012022012410045437",
"有效日期": "2022年1月1日至2023年1月1日",
}
file_name = '{}_{}'.format(data['企业名称'], int(time.time()))