本文整理汇总了Python中gluon.contrib.pyfpdf.FPDF.output方法的典型用法代码示例。如果您正苦于以下问题:Python FPDF.output方法的具体用法?Python FPDF.output怎么用?Python FPDF.output使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gluon.contrib.pyfpdf.FPDF
的用法示例。
在下文中一共展示了FPDF.output方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_me_a_pyfpdf
# 需要导入模块: from gluon.contrib.pyfpdf import FPDF [as 别名]
# 或者: from gluon.contrib.pyfpdf.FPDF import output [as 别名]
def get_me_a_pyfpdf():
title = "This The Doc Title"
heading = "First Paragraph"
text = 'bla '* 10000
pdf=FPDF()
pdf.add_page()
pdf.set_font('Times','B',15)
pdf.cell(w=210,h=9,txt=title,border=0,ln=1,align='C',fill=0)
pdf.set_font('Times','B',15)
pdf.cell(w=0,h=6,txt=heading,border=0,ln=1,align='L',fill=0)
pdf.set_font('Times','',12)
pdf.multi_cell(w=0,h=5,txt=text)
response.headers['Content-Type']='application/pdf'
return pdf.output(dest='S')
示例2: report
# 需要导入模块: from gluon.contrib.pyfpdf import FPDF [as 别名]
# 或者: from gluon.contrib.pyfpdf.FPDF import output [as 别名]
def report():
id = request.args(0) or redirect(URL('index'))
title = "Books"
heading = "First Paragraph"
text = 'xpto ' * 100
pdf = FPDF()
pdf.add_page()
pdf.set_font('Times','B',15)
pdf.cell(w=210,h=9,txt=title,border=0,ln=1,align='C',fill=0)
pdf.set_font('Times','B',15)
pdf.cell(w=0,h=6,txt=heading,border=0,ln=1,align='L',fill=0)
pdf.set_font('Times','',12)
pdf.multi_cell(w=0,h=5,txt=text)
response.headers['Content-Type']='application/pdf'
return pdf.output(name='report.pdf',dest='S')
示例3: get_me_a_pyfpdf
# 需要导入模块: from gluon.contrib.pyfpdf import FPDF [as 别名]
# 或者: from gluon.contrib.pyfpdf.FPDF import output [as 别名]
def get_me_a_pyfpdf():
title = "This The Doc Title"
heading = "First Paragraph"
text = "bla " * 10000
pdf = FPDF()
pdf.add_page()
pdf.set_font("Times", "B", 15)
pdf.cell(w=210, h=9, txt=title, border=0, ln=1, align="C", fill=0)
pdf.set_font("Times", "B", 15)
pdf.cell(w=0, h=6, txt=heading, border=0, ln=1, align="L", fill=0)
pdf.set_font("Times", "", 12)
pdf.multi_cell(w=0, h=5, txt=text)
response.headers["Content-Type"] = "application/pdf"
return pdf.output(dest="S")
示例4: report
# 需要导入模块: from gluon.contrib.pyfpdf import FPDF [as 别名]
# 或者: from gluon.contrib.pyfpdf.FPDF import output [as 别名]
def report():
id = request.args(0) or redirect(URL("index"))
title = "Erwin"
heading = "First Paragraph"
text = "xpto " * 100
pdf = FPDF()
pdf.add_page()
pdf.set_font("Times", "B", 15)
pdf.cell(w=210, h=9, txt=title, border=0, ln=1, align="C", fill=0)
pdf.set_font("Times", "B", 15)
pdf.cell(w=0, h=6, txt=heading, border=0, ln=1, align="L", fill=0)
pdf.set_font("Times", "", 12)
pdf.multi_cell(w=0, h=5, txt=text)
response.headers["Content-Type"] = "application/pdf"
return pdf.output(name="report.pdf", dest="S")
示例5: mypdf3
# 需要导入模块: from gluon.contrib.pyfpdf import FPDF [as 别名]
# 或者: from gluon.contrib.pyfpdf.FPDF import output [as 别名]
def mypdf3():
r=db(request.args[0]==db.details.myid).select()
s=db(request.args[0]==db.project.myid).select()
t=db(request.args[0]==db.achievements.myid).select()
u=db(db.auth_user.id==request.args[0]).select(db.auth_user.email)
from gluon.contrib.pyfpdf import FPDF, HTMLMixin
pdf=FPDF()
pdf.add_page()
pdf.set_font('Arial','BU',40)
#pdf.cell(w=60,h=10,txt="",border=2,align='L',fill='0')
pdf.set_text_color(100,0,100)
pdf.cell(w=80,h=30,txt="Curriculum Vitae",ln=2,border=2,align='L',fill='0')
pdf.set_text_color(0,0,0)
pdf.set_font('Arial','BU',30)
pdf.set_text_color(0,0,100)
pdf.cell(w=80,h=30,txt="Biodata",ln=1,border=2,align='L',fill='0')
pdf.set_font('Arial','',15)
pdf.set_text_color(0,0,0)
pdf.cell(w=60,h=10,txt="Name :",border=2,align='L',fill='0')
pdf.cell(w=60,h=10,txt=r[0].name,ln=1,border=2,align='L',fill='0')
pdf.set_text_color(0,0,0)
pdf.cell(w=60,h=10,txt="Current Year :",border=2,align='L',fill='0')
pdf.cell(w=60,h=10,txt=r[0].current_year,border=2,ln=1,align='L',fill='0')
pdf.cell(w=60,h=10,txt="CGPA :",border=2,align='L',fill='0')
pdf.cell(w=60,h=10,txt=str(r[0].cg),ln=1,border=2,align='L',fill='0')
pdf.cell(w=60,h=10,txt="College :",border=2,align='L',fill='0')
pdf.cell(w=60,h=10,txt=r[0].college,border=2,ln=1,align='L',fill='0')
pdf.cell(w=60,h=10,txt="Branch :",border=2,align='L',fill='0')
pdf.cell(w=60,h=10,txt=r[0].branch,border=2,ln=1,align='L',fill='0')
pdf.set_text_color(0,0,0)
#pdf.cell(w=60,h=10,txt="",ln=1,border=2,align='L',fill='0')
#pdf.cell(w=60,h=10,txt="",ln=1,border=2,align='L',fill='0')
#pdf.cell(w=60,h=10,txt="",ln=1,border=2,align='L',fill='0')
pdf.cell(w=60,h=10,txt="",ln=1,border=2,align='L',fill='0')
pdf.set_font('Arial','BU',30)
pdf.set_text_color(0,0,100)
if len(s) != 0:
pdf.cell(w=60,h=10,txt="Projects/Interns ",border=2,align='L',fill='0')
pdf.cell(w=60,h=10,txt=" ",ln=1,border=2,align='L',fill='0')
pdf.set_text_color(0,0,0)
for i in s:
pdf.set_font('Arial','BI',20)
pdf.cell(w=60,h=10,txt=i.name,ln=1,border=2,align='L',fill='0')
pdf.set_font('Arial','',15)
pdf.cell(w=60,h=10,txt="",ln=1,border=2,align='L',fill='0')
pdf.cell(w=60,h=10,txt="Mentor :",border=2,align='L',fill='0')
pdf.cell(w=60,h=10,txt=i.mentor,ln=1,border=2,align='L',fill='0')
pdf.cell(w=60,h=10,txt="Organistion :",border=2,align='L',fill='0')
pdf.cell(w=60,h=10,txt=i.org,ln=1,border=2,align='L',fill='0')
pdf.cell(w=60,h=10,txt="Description :",border=2,align='L',fill='0')
pdf.cell(w=60,h=10,txt=i.Description,ln=1,border=2,align='L',fill='3')
pdf.cell(w=60,h=10,txt="Skills Used :",border=2,align='L',fill='0')
pdf.cell(w=60,h=10,txt=i.skills_used,ln=1,border=2,align='L',fill='3')
pdf.cell(w=60,h=10,txt="",ln=1,border=2,align='L',fill='0')
#pdf.cell(w=60,h=10,txt="",ln=1,border=2,align='L',fill='0')
pdf.set_font('Arial','BU',30)
pdf.set_text_color(0,0,100)
if len(s) != 0:
pdf.cell(w=60,h=10,txt="Achievements ",border=2,align='L',fill='0')
pdf.cell(w=60,h=10,txt=" ",ln=1,border=2,align='L',fill='0')
pdf.set_text_color(0,0,0)
for i in t:
pdf.set_font('Arial','',15)
pdf.cell(w=60,h=10,txt=i.what,ln=1,border=2,align='L',fill='0')
pdf.cell(w=60,h=10,txt="",ln=1,border=2,align='L',fill='0')
pdf.cell(w=60,h=10,txt="",ln=1,border=2,align='L',fill='0')
pdf.cell(w=60,h=10,txt="",ln=1,border=2,align='L',fill='0')
pdf.set_font('Arial','BU',30)
pdf.set_text_color(0,0,100)
pdf.cell(w=60,h=10,txt="Contact Details",ln=1,border=2,align='L',fill='0')
pdf.cell(w=60,h=10,txt="",ln=1,border=2,align='L',fill='0')
pdf.set_text_color(0,0,0)
pdf.set_font('Arial','',15)
#pdf.cell(w=40,h=10,txt="Email :",border=2,align='L',fill='0')
pdf.cell(w=60,h=10,txt=u[0].email,ln=1,border=2,align='L',fill='0')
#pdf.cell(w=40,h=10,txt="Address :",border=2,align='L',fill='0')
#pdf.cell(w=60,h=10,txt="",border=2,align='L',fill='0')
pdf.cell(w=60,h=10,txt=r[0].address+', ',border=2,ln=1,align='L',fill='0')
#pdf.cell(w=60,h=10,txt="",border=2,align='L',fill='0')
pdf.cell(w=60,h=10,txt=r[0].city+', '+r[0].cstate,border=2,ln=1,align='L',fill='0')
#pdf.cell(w=60,h=10,txt="",border=2,align='L',fill='0')
#pdf.cell(w=60,h=10,txt=r[0].cstate,border=2,ln=1,align='L',fill='0')
response.headers['Content-Type']='application/pdf'
return pdf.output(dest="S")
示例6: mypdf
# 需要导入模块: from gluon.contrib.pyfpdf import FPDF [as 别名]
# 或者: from gluon.contrib.pyfpdf.FPDF import output [as 别名]
#.........这里部分代码省略.........
pdf.set_font('Arial','',15)
pdf.set_text_color(0,0,0)
pdf.cell(w=60,h=10,txt="",border=2,align='L',fill='0')
pdf.cell(w=60,h=10,txt=r[0].address2,ln=1,border=2,align='L',fill='0')
pdf.set_font('Arial','',15)
pdf.set_text_color(0,0,0)
pdf.cell(w=60,h=10,txt="",border=2,align='L',fill='0')
pdf.cell(w=60,h=10,txt=r[0].address3,ln=1,border=2,align='L',fill='0')
pdf.set_font('Arial','',15)
pdf.set_text_color(0,0,0)
pdf.cell(w=60,h=10,txt="Contact",border=2,align='L',fill='0')
pdf.cell(w=60,h=10,txt=r[0].contact,ln=1,border=2,align='L',fill='0')
pdf.set_font('Arial','',15)
pdf.set_text_color(0,0,0)
pdf.cell(w=60,h=10,txt="E-mail :",border=2,align='L',fill='0')
pdf.cell(w=60,h=10,txt=r[0].email,ln=1,border=2,align='L',fill='0')
if len(a):
pdf.set_text_color(0,0,0)
pdf.set_font('Arial','BU',30)
pdf.set_text_color(0,0,100)
pdf.cell(w=80,h=30,txt="EDUCATION",ln=1,border=2,align='L',fill='0')
for x in a:
pdf.set_font('Arial','',15)
pdf.set_text_color(0,0,0)
#pdf.cell(w=60,h=10,txt=s[0].name :",border=2,align='L',fill='0')
pdf.cell(w=60,h=10,txt=x.title,border=2,align='L',fill='0')
pdf.cell(w=60,h=10,txt=x.name,ln=1,border=2,align='L',fill='0')
if len(b):
pdf.set_text_color(0,0,0)
pdf.set_font('Arial','BU',30)
pdf.set_text_color(0,0,100)
pdf.cell(w=80,h=30,txt="WORK EXPERIENCE",ln=1,border=2,align='L',fill='0')
pdf.set_font('Arial','',15)
pdf.set_text_color(0,0,0)
for x in b:
#pdf.cell(w=60,h=10,txt=s[0].name :",border=2,align='L',fill='0')
pdf.cell(w=60,h=10,txt=x.name,border=2,align='L',fill='0')
pdf.cell(w=60,h=10,txt=x.as_post,border=2,align='L',fill='0')
pdf.cell(w=60,h=10,txt=x.type_of,ln=1,border=2,align='L',fill='0')
if len(s):
pdf.set_text_color(0,0,0)
pdf.set_font('Arial','BU',30)
pdf.set_text_color(0,0,100)
pdf.cell(w=80,h=30,txt="COURSES TAKEN",ln=1,border=2,align='L',fill='0')
for x in s:
pdf.set_font('Arial','',15)
pdf.set_text_color(0,0,0)
#pdf.cell(w=60,h=10,txt=s[0].name :",border=2,align='L',fill='0')
pdf.cell(w=60,h=10,txt=x.name,ln=1,border=2,align='L',fill='0')
if len(t):
pdf.set_text_color(0,0,0)
pdf.set_font('Arial','BU',30)
pdf.set_text_color(0,0,100)
pdf.cell(w=80,h=30,txt="PROJECTS DONE",ln=1,border=2,align='L',fill='0')
pdf.set_font('Arial','',15)
pdf.set_text_color(0,0,0)
pdf.cell(w=60,h=10,txt="Project Name:",border=2,align='L',fill='0')
pdf.cell(w=60,h=10,txt="Project Details:",ln=1,border=2,align='L',fill='0')
for x in t:
#pdf.cell(w=60,h=10,txt=s[0].name :",border=2,align='L',fill='0')
pdf.cell(w=60,h=10,txt=x.name,border=2,align='L',fill='0')
pdf.cell(w=60,h=10,txt=x.detail,ln=1,border=2,align='L',fill='0')
if len(u):
pdf.set_text_color(0,0,0)
pdf.set_font('Arial','BU',30)
pdf.set_text_color(0,0,100)
pdf.cell(w=80,h=30,txt="OTHER ACTIVITIES:",ln=1,border=2,align='L',fill='0')
pdf.set_font('Arial','',15)
pdf.set_text_color(0,0,0)
pdf.cell(w=60,h=10,txt="Name:",border=2,align='L',fill='0')
pdf.cell(w=60,h=10,txt="Details:",ln=1,border=2,align='L',fill='0')
for x in u:
#pdf.cell(w=60,h=10,txt=s[0].name :",border=2,align='L',fill='0')
pdf.cell(w=60,h=10,txt=x.title,border=2,align='L',fill='0')
pdf.cell(w=60,h=10,txt=x.info,ln=1,border=2,align='L',fill='0')
if len(c):
pdf.set_text_color(0,0,0)
pdf.set_font('Arial','BU',30)
pdf.set_text_color(0,0,100)
pdf.cell(w=80,h=30,txt="ACHIEVEMENTS",ln=1,border=2,align='L',fill='0')
pdf.set_font('Arial','',15)
pdf.set_text_color(0,0,0)
pdf.cell(w=60,h=10,txt="Name:",border=2,align='L',fill='0')
pdf.cell(w=60,h=10,txt="Details:",ln=1,border=2,align='L',fill='0')
for x in c:
#pdf.cell(w=60,h=10,txt=s[0].name :",border=2,align='L',fill='0')
pdf.cell(w=60,h=10,txt=x.title,border=2,align='L',fill='0')
pdf.cell(w=60,h=10,txt=x.detail,ln=1,border=2,align='L',fill='0')
response.headers['Content-Type']='application/pdf'
return pdf.output(dest="S")