0

I am using WebRenderer to export HTML5 pages to images on the server. The problem is that the only edition that supports HTML5 is the swing edition. However, I can use the jar files from the swing edition and create a new IMozillaBrowserCanvas object and not link it to a JFrame/JPanel and have it convert the html5 page without a GUI.

Are there any differences between the swing and server edition when just using IMozillaBrowserCanvas? The only info I could was find was this:

The WebRenderer Server Edition 4.0 scales better in server and headless environments than any other Java browser SDK due to the fact that rendering is not performed on the Swing Thread. Keeping rendering off the Swing Thread, and multi-threading the rendering leads to major improvements in scalability. [Source]

Also, what is happening in the back end when the spawnMozilla() method is being called from the BrowserFactory class? To my knowledge, this is just a pure java browser and not running xserver in the background.

Linger
  • 14,942
  • 23
  • 52
  • 79
KrispyDonuts
  • 1,262
  • 2
  • 18
  • 37

1 Answers1

2

I have contacted the developer from WebRenderer. He said:

There are mostly internal architectural differences between the Server and Swing Editions of WebRenderer. The Server Edition was designed primarily for creating images of pages, whereas the Swing Edition is a fully functional browser. However, this does not prevent the Swing Edition from being used efficiently to generate page images.

The API is similar, although the Server has convenience methods for different sizes/types of image generation, and the Swing Edition has more features available. The version of the underlying Mozilla browser is much more recent in the Swing Edition, so it is capable of rendering pages that make use of technologies such as HTML5.

While the rendering is all done in Java, the Mozilla component needs to be handled natively for each platform. It does not run an xserver, but the spawnMozilla() call will set up these native components, they are extracted to the .webrendererswing6 directory in the user home directory by default.

Luke
  • 409
  • 3
  • 12
KrispyDonuts
  • 1,262
  • 2
  • 18
  • 37