def index():
return dict(message="hello world")
In views/default/index.pdf
{{
from reportlab.platypus import *
from reportlab.lib.styles import getSampleStyleSheet
import reportlab.lib.colors as colors
from cgi import escape
styles = getSampleStyleSheet()
title = "DePaul University Enrollment Projections"
doc = SimpleDocTemplate("phello.pdf")
story = []
story.append(Paragraph(escape(message),styles["Heading2"]))
doc.build(story)
response.headers['Content-Type']='application/pdf'
response.write(open("phello.pdf","rb").read(),escape=False)
}}
then visit index.pdf
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"web2py-users" 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
-~----------~----~----~----~------~----~------~--~---