18

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.

jonny
  • 3,111
  • 9
  • 41
  • 57
  • My company was looking for a similar thing (HTML to PDF, actually) and couldn't find anything convenient and prepackaged. We had an idea to embed a stripped-down web browser and basically tell it to print the webpage in question. Ultimately, though, we decided it wasn't worth it for our (modest) needs. –  Apr 16 '10 at 18:27
  • @fennec, you should definetly evaluate http://code.google.com/p/wkhtmltopdf – jonny Nov 25 '10 at 16:01
  • on behalf of our product management people, thanks for your pointer. :) –  Nov 30 '10 at 21:36

2 Answers2

16

Here are 'local' solutions:

Michael
  • 5,910
  • 4
  • 52
  • 74
jonny
  • 3,111
  • 9
  • 41
  • 57
  • The wkhtmltoimage link above takes you to wkhtmltopdf, which doesn't appear to have the option to convert to pn. Only pdf and ps formats: http://wkhtmltopdf.org/usage/wkhtmltopdf.txt. Help? – spadeworkers Aug 26 '14 at 01:06
  • 1
    @spadeworkers, just download the package, it contains both `wkhtmltoimage` and `wkhtmltopdf` binaries – jonny Oct 29 '14 at 20:16
  • wkhtmltoimage is in C language.. i need such thing in php. any help pleaseee?? – saadk Nov 22 '16 at 11:34
  • @saadk you can use `exec` or `system` command in php after installing `wkhtmltoimage` in server like `system('webkit2png http://www.google.com')` – Kathrecha Krishna Jul 08 '20 at 07:38
1

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

Tyler
  • 273
  • 1
  • 14