It would be
def makepdf():
from reportlab.pdfgen import canvas
import gluon.contrib.pyrtf as q
print ('--')
c=canvas.Canvas("primer.pdf")
c.drawString(150,400, "REPORTLAB")
c.showPage()
c.save()
response.headers['Content-Type']='application/pdf'
response.headers['Content-Disposition'] =
'attachment;filename=solicitud.pdf'
return response.stream(open("primer.pdf", 'rb'))
thank you very much.
On 2 jul, 10:35, Álvaro Justen [Turicas] <[email protected]>
wrote:
> On Thu, Jul 2, 2009 at 11:55, __Kyo__<[email protected]> wrote:
> > thanks, and here it is a part of my code, i do not know what to write
> > in to me return.
>
> Try this:
>
> > def makepdf():
> > from reportlab.pdfgen import canvas
> > import gluon.contrib.pyrtf as q
>
> filename = "/home/.../primer.pdf" #we do not recommend to use
> other path instead of web2py/app path to save files.>
> c=canvas.Canvas(filename)
> > c.drawString(150,400, "REPORTLAB")
> > c.showPage()
> > c.save()
> > response.headers['Content-Type']='application/pdf'
> > response.headers['Content-Disposition'] =
> > 'attachment;filename=solicitud.pdf'
>
> return response.stream(open(filename, 'rb'))
>
> --
> Álvaro Justen
> Peta5 - Telecomunicações e Software Livre
> 21 3021-6001 / 9898-0141
> http://www.peta5.com.br/
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"web2py Web Framework" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---