Flow of control







The ultimate aim of WebRenderer Server Edition is to provide rendered pages to the caller without the requirement of rendering the page to a screen. After a document has completely loaded (including content such as images), via loadURL or loadHTML an onDocumentComplete event is fired. After this time, it is safe to save the rendered page to a bitmap. The code below shows use of the onDocumentComplete NetworkEvent to do this.



browser.addNetworkListener( new NetworkAdapter() {
    public void onDocumentComplete( com.webrenderer.event.NetworkEvent e ) {
    // Saving the page to disk as a PNG image (JPG also available)
        browser.savePageImageToDisk(new File("mywebpage.png"), IBrowserCanvas.IMAGE_FORMAT_PNG);


With the example above the path for saving image file is the directory from which the application was run.

As the WebRenderer Server Edition is not rendering to a screen, it is able to render the entire page rather than a small window onto it.  Consequently, some images can be quite large.










 Copyright © JadeLiquid Software - www.jadeliquid.com