开发者

rendering html to png (server-side) [closed]

开发者 https://www.devze.com 2022-12-26 20:44 出处:网络
As it currently stands, this question is not a good fit for our Q&A format. We expect开发者_Go百科 answers to be supported by facts, references,or expertise, but this question will likely soli
As it currently stands, this question is not a good fit for our Q&A format. We expect开发者_Go百科 answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 9 years ago.

I have a workflow model. Internet Explorer doesn't support some features required for model editing functionality (and regular user doesn't need it).

I want a read-only preview of my model. Is it possible to server-side render my HTML to an image?

I would prefer offline solution to allow our system run in corporate LAN without access to internet.


Here are 'local' solutions:

  • wkhtmltoimage from the wkhtmltopdf package

    does exactly its name says

  • PhantomJS

    more advanced capabilities, like evaluating any js code in the page's context before rendering it to an image or pdf.


You can try using a java library called flyingsaucer (aka xhtmlrenderer). It has worked very well for me in the past.

Homepage: http://code.google.com/p/flying-saucer//

FAQ for generating an image: http://pigeonholdings.com/projects/flyingsaucer/R8/doc/guide/users-guide-R8.html#xil_29

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号