Python - 将HTML内容呈现给GIF图像 [英] Python - render HTML content to GIF image

查看:526
本文介绍了Python - 将HTML内容呈现给GIF图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何将HTML内容呈现为GIF图像?



我发现如何使用reportlab将其呈现为PDF,但没有使用GIF。 b
$ b

我想要类似xhtml2pdf.com的东西,但最终的结果应该不是pdf,而是图片。 解决方案 div>

还有一个类似的SO问题,用于呈现HTML和javascript的Python库,但我不确定答案是否令人满意。



我可能会尝试两阶段渲染:HTML - > pdf - > gif。在这种情况下,reportlab可以获得pdf和PythonMagick( http://wiki.python.org/moin/ ImageMagick )可以将PDF转换为GIF。


How can I render HTML content to GIF image?

I found how to render it to PDF using reportlab, but no luck with GIF.

I want something like xhtml2pdf.com but final result should be not in pdf, but in image.

解决方案

There's a similar SO question, Python library for rendering HTML and javascript , but I'm not sure the answers are satisfying.

I might try two-stage rendering: HTML -> pdf -> gif. In that case, reportlab gets you pdf, and PythonMagick (http://wiki.python.org/moin/ImageMagick) can convert the pdf to GIF.

这篇关于Python - 将HTML内容呈现给GIF图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆