Server Generated web screenshots?

后端 未结 8 1682
星月不相逢
星月不相逢 2020-12-09 06:42

One problem I\'ve been toying with off and on is a service that requires my server to produce a screenshot of a webpage at a given url. The problem is that I don\'t have any

相关标签:
8条回答
  • 2020-12-09 07:10

    A non-free solution for Java is WebRenderer. Interesting feature: it can emulate Safari, IE or Firefox browsers when rendering. They have a desktop version and a headless server version. Also they have example code showing how to render a screenshot image of a webpage.

    0 讨论(0)
  • 2020-12-09 07:20

    IF your server is a Mac, then I recommend webkit2png, which is a short python program that leverages WebKit's Objective-C API to render an URL. Personally, I use it in combination with WWW::Mechanize to walk my development site and make screenshots of every page -- useful for testing functionality, showing clients and keeping screenshots up-to-date. The resulting screenshot is perfect, but sometimes very tall for long, scrolling pages.

    IF your server has a non-bare-bones Linux distro with KDE installed, then you might try khtml2png. I have not tried that myself, but saw it mentioned on the webkit2png page.

    0 讨论(0)
提交回复
热议问题