SP/web2py/applications/welcome/views/generic.pdf

12 lines
300 B
Plaintext
Raw Normal View History

2018-10-25 15:33:07 +00:00
{{
import os
from gluon.contrib.generics import pdf_from_html
filename = '%s/%s.html' % (request.controller,request.function)
if os.path.exists(os.path.join(request.folder,'views',filename)):
html=response.render(filename)
else:
html=BODY(BEAUTIFY(response._vars))
pass
=pdf_from_html(html)
}}