Hi,

Here is a simple controller.

def test_fpdf():
    from gluon.contrib.pyfpdf import FPDF, HTMLMixin
    title = "This The Doc Title"
    heading = "First Paragraph"
    text = 'bla'
    # create a small table with some data:
    rows_body = []
    for data in db(db.person.id > 0).select():
        rows_body.append([TD(str(data.name)), TD(str(data.age))])
    table=TABLE(THEAD(TR(TH("Name"), TH("Age"))),*[TR(*rows) for rows in 
rows_body])
    pdf=FPDF()
    pdf.add_page()
    pdf.write_html(str(XML(table, sanitize=False)))
    response.headers['Content-Type']='application/pdf'
    return pdf.output(dest='S')

I get an error:

    <type 'exceptions.AttributeError'>('FPDF' object has no attribute 
'write_html')

Any idea why ?

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to