-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpdf2.py
38 lines (28 loc) · 888 Bytes
/
pdf2.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# Python program to create
# a pdf file
from fpdf import FPDF
# save FPDF() class into a
# variable pdf
def send_pdf(individual x):
pdf = FPDF()
# Add a page
pdf.add_page()
# set style and size of font
# that you want in the pdf
pdf.set_font("Arial", size = 15)
# create a cell
pdf.cell(200, 10, txt = "NATIONAL DIGITAL HEALTH PORTAL",
ln = 1, align = 'C')
# add another cell
pdf.cell(200, 10, txt = "DIGITAL HEALTH CARD.",
ln = 2, align = 'C')
# save the pdf with name .pdf
data = current_user.get_name()
img = qrcode.make(data)
path = "C:\\minor\\static\\" + data
pdf.output("GFG.pdf", "F")
send_pdf()
#$filename="test.pdf";
#//Output the document
#$dir = "/G:/PDF/test.pdf/"; // full path like C:/xampp/htdocs/file/file/
#$pdf->Output($dir.$filename,'F');