Spaces:
Sleeping
Sleeping
Update src/pyscripts/file_process.py
Browse files
src/pyscripts/file_process.py
CHANGED
|
@@ -36,16 +36,16 @@ def getInvitationPDF(data):
|
|
| 36 |
|
| 37 |
|
| 38 |
def writeInvitationPDF(person):
|
| 39 |
-
font_size=
|
| 40 |
pdf_path = pdf_path_dict[person.category]
|
| 41 |
doc = fitz.open(pdf_path)
|
| 42 |
page = doc.load_page(1)
|
| 43 |
page.insert_font(fontname="name_font", fontfile=font_path)
|
| 44 |
page.insert_font(fontname="f", fontfile=font_path)
|
| 45 |
-
page.insert_text((
|
| 46 |
person.name+person.title, fontname="name_font", fontsize=min(font_size, font_size*5/len(person.name+person.title)), color=(1, 1, 1))
|
| 47 |
if person.category == "演讲" or person.category == "致辞":
|
| 48 |
-
page.insert_text((
|
| 49 |
person.conference, fontname="f", fontsize=min(font_size, font_size*14/len(person.conference)), color=(1, 1, 1))
|
| 50 |
pdfStream = io.BytesIO()
|
| 51 |
doc.save(pdfStream)
|
|
|
|
| 36 |
|
| 37 |
|
| 38 |
def writeInvitationPDF(person):
|
| 39 |
+
font_size=70
|
| 40 |
pdf_path = pdf_path_dict[person.category]
|
| 41 |
doc = fitz.open(pdf_path)
|
| 42 |
page = doc.load_page(1)
|
| 43 |
page.insert_font(fontname="name_font", fontfile=font_path)
|
| 44 |
page.insert_font(fontname="f", fontfile=font_path)
|
| 45 |
+
page.insert_text((380, 220),
|
| 46 |
person.name+person.title, fontname="name_font", fontsize=min(font_size, font_size*5/len(person.name+person.title)), color=(1, 1, 1))
|
| 47 |
if person.category == "演讲" or person.category == "致辞":
|
| 48 |
+
page.insert_text((210, 980),
|
| 49 |
person.conference, fontname="f", fontsize=min(font_size, font_size*14/len(person.conference)), color=(1, 1, 1))
|
| 50 |
pdfStream = io.BytesIO()
|
| 51 |
doc.save(pdfStream)
|