generic.pdf 306 B

123456789101112
  1. {{
  2. import os
  3. from gluon.contrib.generics import pdf_from_html
  4. filename = '%s/%s.html' % (request.controller,request.function)
  5. if os.path.exists(os.path.join(request.folder,'views',filename)):
  6. html=response.render(filename)
  7. else:
  8. html=BODY(BEAUTIFY(response._vars)).xml()
  9. pass
  10. =pdf_from_html(html)
  11. }}