Subscribe Us

Header Ads

How to Convert Text File To PDF File using python | Python projects for begginer |

Hey Guys in this video i am Gonna tell you How You can convert text file to pdf file... Using python..



Source Code...

#required module-pip install fpdf from fpdf import FPDF
#intializing fpdf mypdf = FPDF()
#adding a page mypdf.add_page()
#setting a font mypdf.set_font('times', size=16)
#opening a file f = open('myfile.txt', 'r')
#reading a file line by line and adding to pdf for i in f: mypdf.cell(200, 12, txt=i, ln=1, align='C')
#creating a pdf mypdf.output('mypdf.pdf')


Post a Comment

0 Comments