SP/web2py/applications/welcome/views/generic.pdf
Saturneic 064f602b1a Add.
2018-10-25 23:33:13 +08:00

12 lines
300 B
Plaintext

{{
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)
}}