Hi,
I've created a little function that makes use of wkhtmltopdf (http://
code.google.com/p/wkhtmltopdf/) to get PDF content from HTML content.
I would like to use some controllers to get a PDF version of the HTML
content defined in the corresponding template.
@expose('foo.html')
def foo(self, *args, **kwargs):
return dict(....)
I've been making some experiments with a middleware class.
response.content_type = 'application/pdf'
response.body = to_pdf(response.body)
return response(environ, start_response)
It works but I need something to know if I have to make the
translation or not
if is_a_suitable_response:
response.content_type = 'application/pdf'
response.body = to_pdf(response.body)
return response(environ, start_response)
and I don't know how I can "mark" the response to do so. In the other
hand, I don't know if this is the right way to do that.
Thanks a lot
León
--
You received this message because you are subscribed to the Google Groups
"TurboGears" 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/turbogears?hl=en.