当前位置: 首页>>代码示例>>Python>>正文


Python FPDF.add_page方法代码示例

本文整理汇总了Python中gluon.contrib.pyfpdf.FPDF.add_page方法的典型用法代码示例。如果您正苦于以下问题:Python FPDF.add_page方法的具体用法?Python FPDF.add_page怎么用?Python FPDF.add_page使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在gluon.contrib.pyfpdf.FPDF的用法示例。


在下文中一共展示了FPDF.add_page方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: get_me_a_pyfpdf

# 需要导入模块: from gluon.contrib.pyfpdf import FPDF [as 别名]
# 或者: from gluon.contrib.pyfpdf.FPDF import add_page [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')
开发者ID:AndreMassashi,项目名称:web2py-recipes-source,代码行数:17,代码来源:default.py

示例2: report

# 需要导入模块: from gluon.contrib.pyfpdf import FPDF [as 别名]
# 或者: from gluon.contrib.pyfpdf.FPDF import add_page [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')
开发者ID:flavio-casacurta,项目名称:soag,代码行数:17,代码来源:books.py

示例3: get_me_a_pyfpdf

# 需要导入模块: from gluon.contrib.pyfpdf import FPDF [as 别名]
# 或者: from gluon.contrib.pyfpdf.FPDF import add_page [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")
开发者ID:Jbaumotte,项目名称:web2py,代码行数:17,代码来源:default.py

示例4: report

# 需要导入模块: from gluon.contrib.pyfpdf import FPDF [as 别名]
# 或者: from gluon.contrib.pyfpdf.FPDF import add_page [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")
开发者ID:flavio-casacurta,项目名称:soag,代码行数:17,代码来源:erwin.py

示例5: mypdf3

# 需要导入模块: from gluon.contrib.pyfpdf import FPDF [as 别名]
# 或者: from gluon.contrib.pyfpdf.FPDF import add_page [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")
开发者ID:aditya260694,项目名称:Resume-Builder,代码行数:93,代码来源:default.py

示例6: mypdf

# 需要导入模块: from gluon.contrib.pyfpdf import FPDF [as 别名]
# 或者: from gluon.contrib.pyfpdf.FPDF import add_page [as 别名]
def mypdf():
    query=(int)(request.args(0))
    r=db((db.student.student_id==query)).select(db.student.ALL)
    s=db((db.course.student_id==query)).select()
    t=db(db.project.student_id==query).select()
    u=db(db.extra.student_id==query).select()
    a=db(db.institution.student_id==query).select()
    b=db(db.work_expr.student_id==query).select()
    c=db(db.activity.student_id==query).select()
    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="RESUME",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="My Details:",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')
    
    str1=str(r[0].age)
    pdf.set_font('Arial','',15)
    pdf.set_text_color(0,0,0)
    pdf.cell(w=60,h=10,txt="Age :",border=2,align='L',fill='0')
    pdf.cell(w=60,h=10,txt=str1,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="Gender :",border=2,align='L',fill='0')
    pdf.cell(w=60,h=10,txt=r[0].gender,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="Date Of Birth  :",border=2,align='L',fill='0')
    pdf.cell(w=60,h=10,txt=str(r[0].dob),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="Address  :",border=2,align='L',fill='0')
    pdf.cell(w=60,h=10,txt=r[0].address1,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].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)
#.........这里部分代码省略.........
开发者ID:PulkitIIIT,项目名称:Resume-Builder,代码行数:103,代码来源:default.py


注:本文中的gluon.contrib.pyfpdf.FPDF.add_page方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。