Hello, it's basically this:

i want another page with another content, in the same function or document
pdf

from gluon.contrib.pyfpdf import FPDF, HTMLMixin

class MyFPDF(FPDF, HTMLMixin):
def header(self):
self.set_title("Analise de Valores")
self.set_font('Arial', '', 15)
self.cell(0, 10, response.title, 0, 0, 'L')
self.cell(0, 10, '%s VEICULOS' % registros, 0, 0, 'R')
self.line(287, 18, 10, 18)

def footer(self):
self.set_y(-15)
self.set_font('Arial', 'I', 8)
txt = 'Folha %s de %s' % (self.page_no(), self.alias_nb_pages())
self.cell(0, 10, txt, 0, 0, 'C')
self.set_y(-15)
self.set_font('Arial', 'I', 10)
Useratual=auth.user
Useratual = Useratual.first_name + ' ' + Useratual.last_name
Useratual = Useratual.decode("utf-8")
data = datetime.now().strftime('%d/%m/%Y - %H:%M')
self.cell(0, 20, 'Impresso por: %s (%s)' % (Useratual,data), 0, 0, 'C')

pdf = MyFPDF('L')
pdf.add_page('L')
#pdf.write_html( str(XML(table, sanitize=True)).decode("utf-8"))
pdf.write_html('<font size="9">' + table.xml().decode('utf-8') + '</font>')
pdf.add_page('L')
pdf.write_html('<font size="15">' + tabela_totais.xml().decode('utf-8') +
'</font>')
response.headers['Content-Type'] = 'application/pdf'
return pdf.output(dest='S')

2017-01-02 21:20 GMT-02:00 Edwood <edwood.oca...@gmail.com>:

> Happy new year to you too!
>
> Can you post the code? It will be easier to understand the problem.
>
> --
> 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 web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to