Commit
·
69d75a6
1
Parent(s):
c7e38ac
Update app.py
Browse files
app.py
CHANGED
@@ -346,7 +346,8 @@ def generate_certificate(certificate_model, first_name, last_name):
|
|
346 |
rgba = im
|
347 |
rgb = Image.new('RGB', im.size, (255, 255, 255)) # white background
|
348 |
rgb.paste(rgba, mask=rgba.split()[3]) # 3 is the alpha channel
|
349 |
-
|
|
|
350 |
|
351 |
return im, pdf
|
352 |
|
|
|
346 |
rgba = im
|
347 |
rgb = Image.new('RGB', im.size, (255, 255, 255)) # white background
|
348 |
rgb.paste(rgba, mask=rgba.split()[3]) # 3 is the alpha channel
|
349 |
+
pdf_ = rgb.save("certificate.pdf", 'PDF', resolution=100.0)
|
350 |
+
pdf = pdf_.filename
|
351 |
|
352 |
return im, pdf
|
353 |
|