web2py.transcription/views/generic.pdf

12 lines
300 B
Plaintext
Raw Normal View History

2021-10-01 10:29:16 +02: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)
}}