本文整理匯總了Python中gluon.contrib.pyfpdf.FPDF.multi_cell方法的典型用法代碼示例。如果您正苦於以下問題:Python FPDF.multi_cell方法的具體用法?Python FPDF.multi_cell怎麽用?Python FPDF.multi_cell使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類gluon.contrib.pyfpdf.FPDF
的用法示例。
在下文中一共展示了FPDF.multi_cell方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: get_me_a_pyfpdf
# 需要導入模塊: from gluon.contrib.pyfpdf import FPDF [as 別名]
# 或者: from gluon.contrib.pyfpdf.FPDF import multi_cell [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: get_me_a_pyfpdf
# 需要導入模塊: from gluon.contrib.pyfpdf import FPDF [as 別名]
# 或者: from gluon.contrib.pyfpdf.FPDF import multi_cell [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")
示例3: report
# 需要導入模塊: from gluon.contrib.pyfpdf import FPDF [as 別名]
# 或者: from gluon.contrib.pyfpdf.FPDF import multi_cell [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')
示例4: report
# 需要導入模塊: from gluon.contrib.pyfpdf import FPDF [as 別名]
# 或者: from gluon.contrib.pyfpdf.FPDF import multi_cell [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")