com.webrenderer.se
Interface IBrowserCanvas

All Known Subinterfaces:
IMozillaBrowserCanvas

public interface IBrowserCanvas

IBrowserCanvas provides native browsing facilities inside a standard java.awt.Canvas. This interface provides a platform and browser independant mechanism to access these native resources.

Some extra browser-specific functionality can be accessed via other supplied interfaces. For example, Mozilla browsers can access the IMozillaBrowserCanavas interface which allows the user to save a HTML page to a local drive.

See Also:
IMozillaBrowserCanvas

Field Summary
static int IMAGE_FORMAT_JPEG
           
static int IMAGE_FORMAT_PNG
           
static int KEY_CODE_BACKSPACE
           
static int KEY_CODE_DELETE
           
static int KEY_CODE_TAB
           
static int KEY_MODIFIER_CTRL_DOWN
           
static int KEY_MODIFIER_SHIFT_DOWN
           
static int RELOAD_BYPASS_CACHE
          This flag indicates to reload() that it should skip the cache, but still use the proxy.
static int RELOAD_BYPASS_PROXY
          This flag indicates to reload() that it should use the cache, but skip the proxy.
static int RELOAD_BYPASS_PROXY_AND_CACHE
          This flag indicates to reload() that it should skip the cache and proxy.
static int RELOAD_NORMAL
          This flag indicates to reload() that it should use the cache and proxy.
 
Method Summary
 void addBlockedURL(java.lang.String strURL)
          Adds URL to the list of blocked URLs (URLs that are not displayed).
 void addBrowserListener(BrowserListener listener)
          Adds the specified browser listener that will receive browser events from this component.
 void addJavascriptListener(JavascriptListener listener)
          Adds the specified Javascript listener that will receive Javascript events from this component.
 void addNetworkListener(NetworkListener listener)
          Adds the specified network listener that will receive network events from this component.
 void addPromptListener(PromptListener listener)
          Adds a PromptListener.
 void addWindowListener(WindowListener listener)
          Adds the specified window listener that will receive new Window events from this component.
 void autoconfigureProxy(java.lang.String url)
          Indicate a URL which automatically configures the proxy settings for all the protocols.
 boolean canGoBack()
          Indicates whether the browser can navigate backwards in history.
 boolean canGoForward()
          Indicates whether the browser can navigate forwards in history.
 void copy()
          Copies the selected text to the Clipboard This can then be accessed by other applications by using the Paste Command (Ctrl+V)
 void cut()
          Cuts the selected text, removing the selection and adding it to the Clipboard This can then be accessed by other applications by using the Paste Command (Ctrl+V) This command can only be used when setHTMLEditingMode(true) has been called on the IBrowserCanvas
 void decreaseTextZoom()
          Decreases the size of text on the page.
 void deleteCookies()
          Deletes stored cookies.
 void destroy()
          This functions destroys resources allocated by browser canvas.
 void disableCache()
          Disables the cache.
 void disableCookies()
          Disable cookies feature.
 void disableProxy()
          Disable the current proxy settings
 void emptyCache()
          Removes all cache entries.
 void enableCache()
          Enables the cache.
 void enableCookies()
          Enables cookies feature.
 void enableImageLoading(boolean enable)
          Allow images to load.
 void enableProxy()
          Enables the current proxy settings
 void executeScript(java.lang.String javascriptBody)
          Executes the specified script on the currently loaded document.
 java.lang.String executeScriptWithReturn(java.lang.String javascriptBody)
          Executes the specified script on the currently loaded document.
 boolean getBoolPrefProperty(java.lang.String propName)
          Gets the boolean value of a property.
 java.lang.String getBrowserType()
          Returns a string indicating the underlying browser.
 java.lang.String getCompanyName()
          Gets the name of the company.
 java.lang.String getCookie()
          Gets the cookie for the currently loaded domain.
 java.lang.String getCookie(java.lang.String URL)
          Gets the specified cookie.
 java.lang.String getCookieFromHttp(java.lang.String URL)
           
 IDocument getDocument()
          This gives access to the DOM of the loaded document.
 IElement getElementAtCaretPosition(boolean returnTextNodes)
          Retrieves the element under the cursor when in edit mode.
 History getHistory()
          Gets the browser history.
 boolean getHTMLEditingMode()
          Gets whether the current webpage is in editing mode.
 int getIntPrefProperty(java.lang.String propName)
          Gets the integer value of a property.
 boolean getJavascriptEnabled()
          Gets the status of Javascript.
 java.awt.Dimension getMaxRenderSize()
          Gets the current maximum buffer size that pages can render to.
 java.awt.Dimension getPageSize()
          Get the total size in pixels of the current loaded page.
 java.awt.print.Printable getPrintable(boolean scaled)
          Get a Printable object that is used with Java printing.
 java.lang.String getProductName()
          Gets the name of the product.
 java.lang.String getProxyBypasses()
          Gets a string containing the domain names which bypass the given proxy settings.
 ProxySetting getProxyProtocol(int protocol)
          Retrieves the proxy settings for the given protocol.
 java.lang.String getSelectedText()
          Gets the active text selection in the browser.
 java.lang.String getStringPrefProperty(java.lang.String propName)
          Gets the String value of a property.
 java.lang.String getTitle()
          Get the title of the current resource being displayed.
 java.lang.String getURL()
          Get the URL of the current resource being displayed.
 java.lang.String getVersion()
          Get the version of the product as a string.
 java.lang.String getWebRendererVersion()
          Get a version identification string for components of WebRenderer
 void goBack()
          Move backwards through resource history.
 void goForward()
          Move forward through resource history.
 void highlightSelectedText(java.awt.Color colour)
          Changes the background color on the current selection to given color.
 void httpPOST(java.lang.String strURL, java.io.File file, java.lang.String fileVariableName)
          Load URL with File which should be uploaded
 void httpPOST(java.lang.String strURL, java.io.File file, java.lang.String fileVariableName, java.lang.String additionalPOSTData)
          Load URL with POST String Data and File which should be uploaded Format of additionPOSTData parameter: name=Parameter_name\r\n\r\nParamter_value\r\n where Paramter_name is a form field name and Paramter_value is form field value
 void httpPOST(java.lang.String strURL, java.lang.String POSTData)
          Load URL with POST String Data
 void increaseTextZoom()
          Increases the size of text on the page.
 void invokeAndWait(java.lang.Runnable r)
          Runs the given Runnable on the WebRenderer thread and waits until completion.
 void invokeLater(java.lang.Runnable r)
          Runs the given Runnable on the WebRenderer thread.
 boolean isCacheDisabled()
          Gets the disabled status of the cache.
 boolean isCookiesEnabled()
          Gets the on/off status of the cookies feature
 boolean isPopup()
          Get whether this browser is a popup window or not.
 boolean isProxyEnabled()
          Gets the on/off status of the proxy settings
 void loadHTML(byte[] HTML, java.lang.String relativePath)
          Renders the content of a byte array on the IBrowserCanvas
 void loadHTML(java.io.InputStream HTMLStream, java.lang.String relativePath)
          Renders's the content of an Input Stream on the IBrowserCanvas
 void loadHTML(java.lang.String html, java.lang.String relativePath)
          Renders the content of a string on the IBrowserCanvas
 void loadURL(int NavConstants, java.lang.String strURL, byte[] POSTData, java.lang.String TargetFrameName, java.lang.String Headers)
          Load URL with POST Byte Data, Headers data and TargetFrameName
 void loadURL(java.lang.String url)
          Loads the resource at the given URL in the browser window.
 void loadURL(java.net.URL url)
          Loads the resource at the given URL in the browser window.
 java.lang.String makeImageUrl(java.awt.image.BufferedImage img)
          Registers this image in wrimage:// protocol.
 void paste()
          Pastes the text from the clipboard to the current document This command can only be used when setHTMLEditingMode(true) has been called on the IBrowserCanvas
 void print()
          Print the current rendered document/web-page to the default printer.
 void print(boolean scaleWidth, java.awt.print.PageFormat pf)
          Print the current rendered document/web-page to the default printer, using scaling and page format data.
 void reload(int flags)
          Reload the current resource.
 void removeBlockedURL(java.lang.String strURL)
          Removes a URL from the list of blocked URLs.
 void removeBrowserListener(BrowserListener listener)
          Removes the specified browser listener so that it no longer receives browser events from this component.
 void removeImage(java.lang.String imageID)
          Removes a specified image.
 void removeJavascriptListener(JavascriptListener listener)
          Removes the specified Javascript listener so that it no longer receives Javascript events from this component.
 void removeNetworkListener(NetworkListener listener)
          Removes the specified network listener so that it no longer receives network events from this component.
 void removePromptListener(PromptListener listener)
          Removes the specified Prompt listener so that it no longer receives browser events from this component.
 void removeWindowListener(WindowListener listener)
          Removes a WindowListener.
 int savePageImageToDisk(java.io.File fileName, int imageFormat)
          Save contents of HTML page to an image on disk.
 int savePageImageToDisk(java.io.File fileName, int imageFormat, boolean waitForPendingRequests)
          Save contents of HTML page to an image on disk.
 int savePageImageToDiskScaled(java.io.File fileName, int imageFormat, double scalefactor)
          Save contents of HTML page to a scaled image on disk.
 int savePageImageToDiskScaled(java.io.File fileName, int imageFormat, double scalefactor, boolean waitForPendingRequests)
          Save contents of HTML page to a scaled image on disk.
 int savePageImageToDiskScaled(java.io.File fileName, int imageFormat, int width, int height, boolean scaleHeight)
          Save contents of HTML page to a scaled image on disk.
 int savePageImageToDiskScaled(java.io.File fileName, int imageFormat, int width, int height, boolean scaleHeight, boolean waitForPendingRequests)
          Save contents of HTML page to a scaled image on disk.
 java.awt.image.BufferedImage savePageSectionToBufferedImage(int x, int y, int width, int height, boolean breakText)
          Grabs a section of the webpage and returns a BufferedImage.
 java.awt.image.BufferedImage savePageSectionToBufferedImage(int x, int y, int width, int height, boolean breakText, boolean waitForPendingRequests)
          Grabs a section of the webpage and returns a BufferedImage.
 java.awt.image.BufferedImage saveToBufferedImage()
          Saves the current page to a buffered image.
 java.awt.image.BufferedImage saveToBufferedImage(boolean waitForPendingRequests)
          Saves the current page to a buffered image.
 java.awt.image.BufferedImage saveToBufferedImageNoAlpha()
          Saves the current page to a buffered image without an alpha channel.
 java.awt.image.BufferedImage saveToBufferedImageNoAlpha(boolean waitForPendingRequests)
          Saves the current page to a buffered image without an alpha channel.
 java.awt.image.BufferedImage saveToBufferedImageScaled(double scalefactor)
          Saves the current page and scales it to a buffered image.
 java.awt.image.BufferedImage saveToBufferedImageScaled(double scalefactor, boolean waitForPendingRequests)
          Saves the current page and scales it to a buffered image.
 java.awt.image.BufferedImage saveToBufferedImageScaled(int width, int height, boolean scaleheight)
          Saves the current page to specified size and returns a BufferedImage.
 java.awt.image.BufferedImage saveToBufferedImageScaled(int width, int height, boolean scaleheight, boolean waitForPendingRequests)
          Saves the current page to specified size and returns a BufferedImage.
 java.awt.image.BufferedImage saveToBufferedImageScaledNoAlpha(double scalefactor)
          Saves the current page and scales it to a buffered image without an alpha channel.
 java.awt.image.BufferedImage saveToBufferedImageScaledNoAlpha(double scalefactor, boolean waitForPendingRequests)
          Saves the current page and scales it to a buffered image without an alpha channel.
 java.awt.image.BufferedImage saveToBufferedImageScaledNoAlpha(int width, int height, boolean scaleheight)
          Saves the current page to specified size and returns a BufferedImage without an alpha channel.
 java.awt.image.BufferedImage saveToBufferedImageScaledNoAlpha(int width, int height, boolean scaleheight, boolean waitForPendingRequests)
          Saves the current page to specified size and returns a BufferedImage without an alpha channel.
 void saveToFile(java.lang.String filename)
          Saves the currently loaded webpage to disk.
 void selectAll()
          Selects all text on the IBrowserCanvas
 void sendKeyPressToElement(int keyCode, int modifiers)
          Sends a key event to the currently focused element with the given key code and character code.
 void setCookie(java.lang.String Value)
          Sets the cookie for the currently loaded domain.
 void setCookie(java.lang.String URL, java.lang.String Value)
          Sets cookie for a given domain.
 void setHTMLEditingMode(boolean onOff)
          Sets whether the page is in editing mode or not When a page is in editing mode, text can be dragged, and contents can be cut.
 void setJavascriptEnabled(boolean bOnOff)
          Turns javascript on/off If this is called on a browser created with BrowserFactory.spawnInternetExplorer() it must be called directly after spawning the browser.
 void setMaxRenderSize(int width, int height)
          Sets the maximum size of the buffer that the page can render to.
 void setMinimumWidth(int width)
          Change the minimum width of subsequently rendered pages.
 void setPrefProperty(java.lang.String pref, boolean onOff)
          Sets an optional property of the underlying browser.
 void setPrefProperty(java.lang.String pref, int intPref)
          Sets an optional property of the underlying browser.
 void setPrefProperty(java.lang.String pref, java.lang.String stringPref)
          Sets an optional property of the underlying browser.
 void setPrintFooters(java.lang.String leftFooter, java.lang.String rightFooter)
          Set the format of the page footer for print output.
 void setPrintHeaders(java.lang.String leftHeader, java.lang.String rightHeader)
          Set the format of the page header for print output.
 void setProxyBypasses(java.lang.String urls)
          Sets the domain names and URLs which bypass the proxy settings.
 void setProxyProtocol(ProxySetting proxy)
          Sets the proxy settings.
 void setSize(int width, int height)
          Sets the page to a set size.
 void stopLoad()
          Stop the browser from loading a resource.
 void writePageImage(java.io.OutputStream out, int imageFormat)
          Save contents of HTML page to an image.
 void writePageImage(java.io.OutputStream out, int imageFormat, boolean waitForPendingRequests)
          Save contents of HTML page to an image.
 void writePageImageScaled(java.io.OutputStream out, int imageFormat, double scalefactor)
          Save contents of HTML page to a scaled image.
 void writePageImageScaled(java.io.OutputStream out, int imageFormat, double scalefactor, boolean waitForPendingRequests)
          Save contents of HTML page to a scaled image.
 void writePageImageScaled(java.io.OutputStream out, int imageFormat, int width, int height, boolean scaleHeight)
          Save contents of HTML page to a scaled image.
 void writePageImageScaled(java.io.OutputStream out, int imageFormat, int width, int height, boolean scaleHeight, boolean waitForPendingRequests)
          Save contents of HTML page to a scaled image.
 

Field Detail

KEY_MODIFIER_SHIFT_DOWN

static final int KEY_MODIFIER_SHIFT_DOWN
See Also:
Constant Field Values

KEY_MODIFIER_CTRL_DOWN

static final int KEY_MODIFIER_CTRL_DOWN
See Also:
Constant Field Values

KEY_CODE_BACKSPACE

static final int KEY_CODE_BACKSPACE
See Also:
Constant Field Values

KEY_CODE_TAB

static final int KEY_CODE_TAB
See Also:
Constant Field Values

KEY_CODE_DELETE

static final int KEY_CODE_DELETE
See Also:
Constant Field Values

RELOAD_NORMAL

static final int RELOAD_NORMAL
This flag indicates to reload() that it should use the cache and proxy.

See Also:
reload(int), Constant Field Values

RELOAD_BYPASS_CACHE

static final int RELOAD_BYPASS_CACHE
This flag indicates to reload() that it should skip the cache, but still use the proxy.

See Also:
reload(int), Constant Field Values

RELOAD_BYPASS_PROXY

static final int RELOAD_BYPASS_PROXY
This flag indicates to reload() that it should use the cache, but skip the proxy.

See Also:
reload(int), Constant Field Values

RELOAD_BYPASS_PROXY_AND_CACHE

static final int RELOAD_BYPASS_PROXY_AND_CACHE
This flag indicates to reload() that it should skip the cache and proxy.

See Also:
reload(int), Constant Field Values

IMAGE_FORMAT_PNG

static final int IMAGE_FORMAT_PNG
See Also:
Constant Field Values

IMAGE_FORMAT_JPEG

static final int IMAGE_FORMAT_JPEG
See Also:
Constant Field Values
Method Detail

getBrowserType

java.lang.String getBrowserType()
Returns a string indicating the underlying browser. Currently returns either:

These values can be used to cast a IBrowserCanvas interface to a more platform specific interface in order to access added functionality. Examples of this are given at IMozillaBrowserCanvas

Returns:
String Name of underlying browser

getProductName

java.lang.String getProductName()
Gets the name of the product. String "Webrenderer".

Returns:
String The product name

getVersion

java.lang.String getVersion()
Get the version of the product as a string. This is in the format x.y.zv eg 1.0.1b

Returns:
String The version

getWebRendererVersion

java.lang.String getWebRendererVersion()
Get a version identification string for components of WebRenderer

Returns:
String Version

getCompanyName

java.lang.String getCompanyName()
Gets the name of the company. String "JadeLiquid Software".

Returns:
String The company name

copy

void copy()
Copies the selected text to the Clipboard This can then be accessed by other applications by using the Paste Command (Ctrl+V)


cut

void cut()
Cuts the selected text, removing the selection and adding it to the Clipboard This can then be accessed by other applications by using the Paste Command (Ctrl+V) This command can only be used when setHTMLEditingMode(true) has been called on the IBrowserCanvas


selectAll

void selectAll()
Selects all text on the IBrowserCanvas


loadURL

void loadURL(java.lang.String url)
Loads the resource at the given URL in the browser window.

Parameters:
url - The URL of the resource to load.

loadURL

void loadURL(java.net.URL url)
Loads the resource at the given URL in the browser window.

Parameters:
url - The URL of the resource to load.

stopLoad

void stopLoad()
Stop the browser from loading a resource.


reload

void reload(int flags)
Reload the current resource. The operation of the method can be changed by supplying different flags, defined using the static RELOAD_* variables. Current ability allows reloading a resource by selectively bypassing the browsers cache and/or proxy server.

Parameters:
flags - Defines the operation of reload using the RELOAD_* variables.
See Also:
RELOAD_NORMAL, RELOAD_BYPASS_CACHE, RELOAD_BYPASS_PROXY, RELOAD_BYPASS_PROXY_AND_CACHE

canGoBack

boolean canGoBack()
Indicates whether the browser can navigate backwards in history.

Returns:
boolean true if it can navigate backwards.

loadHTML

void loadHTML(java.lang.String html,
              java.lang.String relativePath)
Renders the content of a string on the IBrowserCanvas

Parameters:
html - - A string containing the HTML code to display
relativePath - - The relative path from the current working directory to load images from note: localPath should point to writable location. with set protocol prefix like file:/// and / as last character is essential example file:///E:/htmlresources/ If localPath is an empty string then current application path used as an absolute base path for files.

Example Usage:
//Relative file File file = new File("mypages"); browser.loadHTML(htmlString, file.toURL().toString());


loadHTML

void loadHTML(byte[] HTML,
              java.lang.String relativePath)
Renders the content of a byte array on the IBrowserCanvas

Parameters:
HTML - - A byte array containing the HTML code to display
relativePath - - The relative path from the current working directory to load images from note: localPath should point to writable location. with set protocol prefix like file:/// and / as last character is essential example file:///E:/htmlresources/ If localPath is an empty string then current application path used as an absolute base path for files.

Example Usage:
//Relative file File file = new File("mypages"); browser.loadHTML(htmlString, file.toURL().toString());


loadHTML

void loadHTML(java.io.InputStream HTMLStream,
              java.lang.String relativePath)
Renders's the content of an Input Stream on the IBrowserCanvas

Parameters:
HTMLStream - - An InputStream containing the HTML code to display
relativePath - - The relative path from the current working directory to load images from note: localPath should point to writable location. with set protocol prefix like file:/// and / as last character is essential example file:///E:/htmlresources/ If localPath is an empty string then current application path used as an absolute base path for files.

Example Usage:
//Relative file File file = new File("mypages"); browser.loadHTML(htmlString, file.toURL().toString());


canGoForward

boolean canGoForward()
Indicates whether the browser can navigate forwards in history. This is true if goBack() has been previously called

Returns:
boolean true if it can navigate forwards.

goBack

void goBack()
Move backwards through resource history.


goForward

void goForward()
Move forward through resource history.


getTitle

java.lang.String getTitle()
Get the title of the current resource being displayed. For HTML resources, this will be the text contained within the title tag.

Returns:
String The title of the current resource.

getURL

java.lang.String getURL()
Get the URL of the current resource being displayed.

Returns:
String The URL of the current resource.

isPopup

boolean isPopup()
Get whether this browser is a popup window or not.

Returns:
boolean True if the browser is a popup.

enableProxy

void enableProxy()
Enables the current proxy settings

See Also:
disableProxy()

disableProxy

void disableProxy()
Disable the current proxy settings

See Also:
enableProxy()

isProxyEnabled

boolean isProxyEnabled()
Gets the on/off status of the proxy settings

Returns:
boolean True if the proxy settings are active
See Also:
enableProxy(), disableProxy()

getProxyProtocol

ProxySetting getProxyProtocol(int protocol)
Retrieves the proxy settings for the given protocol. The protocol is specified by the PROTOCOL_* flags defined in ProxySetting

Parameters:
protocol - Identify which protocol settings to retrieve
Returns:
ProxySetting Holds the returned proxy settings

setProxyProtocol

void setProxyProtocol(ProxySetting proxy)
Sets the proxy settings. The settings contained in the given ProxySetting define a single protocol at a time. This function only sets the proxy protocol. The proxy needs to be explicitly enabled for it to be active.

Parameters:
proxy - The proxy settings for a single protocol.
See Also:
enableProxy(), disableProxy()

getProxyBypasses

java.lang.String getProxyBypasses()
Gets a string containing the domain names which bypass the given proxy settings.

Returns:
String Domains bypassing the proxy.

setProxyBypasses

void setProxyBypasses(java.lang.String urls)
Sets the domain names and URLs which bypass the proxy settings. The URLs are delimited by commas. The following are some examples:

www.jadeliquid.com bypasses for that specific URL
.jadeliquid.com bypass jadeliquid domain
.gnome.org, .kde.org bypass gnome.org and kde.org domains

Parameters:
urls - Domains to bypass the proxy.

autoconfigureProxy

void autoconfigureProxy(java.lang.String url)
Indicate a URL which automatically configures the proxy settings for all the protocols.

Parameters:
url - URL of proxy automatic configuration setting

getDocument

IDocument getDocument()
This gives access to the DOM of the loaded document. The returned IDocument is only valid while the current page is loaded. This function should not be called until the NetworkEvent onDocumentComplete has fired.

Returns:
The Document currently loaded

getJavascriptEnabled

boolean getJavascriptEnabled()
Gets the status of Javascript.

Returns:
true if Javascript is enabled.
See Also:
setJavascriptEnabled(boolean)

setJavascriptEnabled

void setJavascriptEnabled(boolean bOnOff)
Turns javascript on/off If this is called on a browser created with BrowserFactory.spawnInternetExplorer() it must be called directly after spawning the browser. The spawnMozilla version of the method can be called anytime with the effects happening on the next page load

See Also:
getJavascriptEnabled()

getHistory

History getHistory()
Gets the browser history.

Returns:
Object containing browser history

saveToFile

void saveToFile(java.lang.String filename)
Saves the currently loaded webpage to disk. The URL must be loaded before calling this method.

Parameters:
filename - The path and name of the file to save the document as

getHTMLEditingMode

boolean getHTMLEditingMode()
Gets whether the current webpage is in editing mode. This can be set with setHTMLEditingMode(boolean) Default is false

Returns:
true if page is in editing mode

setHTMLEditingMode

void setHTMLEditingMode(boolean onOff)
Sets whether the page is in editing mode or not When a page is in editing mode, text can be dragged, and contents can be cut. Also text can be added by typing and with paste.

By default this is set to false. This function is currently not available on a ISafariBrowserCanvas

Parameters:
onOff - set to true to enable editing mode

loadURL

void loadURL(int NavConstants,
             java.lang.String strURL,
             byte[] POSTData,
             java.lang.String TargetFrameName,
             java.lang.String Headers)
Load URL with POST Byte Data, Headers data and TargetFrameName

Parameters:
NavConstants -
strURL -
POSTData -
TargetFrameName -
Headers -

paste

void paste()
Pastes the text from the clipboard to the current document This command can only be used when setHTMLEditingMode(true) has been called on the IBrowserCanvas


savePageImageToDisk

int savePageImageToDisk(java.io.File fileName,
                        int imageFormat)
Save contents of HTML page to an image on disk. NOTE: PNG image creation is less JVM memory intensive.

Parameters:
fileName - File to output.
imageFormat - Output format of the file. (IMAGE_FORMAT_PNG or IMAGE_FORMAT_JPG)

savePageImageToDisk

int savePageImageToDisk(java.io.File fileName,
                        int imageFormat,
                        boolean waitForPendingRequests)
Save contents of HTML page to an image on disk. NOTE: PNG image creation is less JVM memory intensive.

Parameters:
fileName - File to output.
imageFormat - Output format of the file. (IMAGE_FORMAT_PNG or IMAGE_FORMAT_JPG)
waitForPendingRequests - if set to true will wait for all pending requests to complete before saving.

savePageImageToDiskScaled

int savePageImageToDiskScaled(java.io.File fileName,
                              int imageFormat,
                              double scalefactor)
Save contents of HTML page to a scaled image on disk. NOTE: PNG image creation is less JVM memory intensive.

Parameters:
fileName - File to output.
imageFormat - Output format of the file. (IMAGE_FORMAT_PNG or IMAGE_FORMAT_JPG)
scalefactor - Less than 1.0 and greater than 0.0 to scale down, bigger than 1.0 to scale up.

savePageImageToDiskScaled

int savePageImageToDiskScaled(java.io.File fileName,
                              int imageFormat,
                              double scalefactor,
                              boolean waitForPendingRequests)
Save contents of HTML page to a scaled image on disk. NOTE: PNG image creation is less JVM memory intensive.

Parameters:
fileName - File to output.
imageFormat - Output format of the file. (IMAGE_FORMAT_PNG or IMAGE_FORMAT_JPG)
scalefactor - Less than 1.0 and greater than 0.0 to scale down, bigger than 1.0 to scale up.
waitForPendingRequests - if set to true will wait for all pending requests to complete before saving.

savePageImageToDiskScaled

int savePageImageToDiskScaled(java.io.File fileName,
                              int imageFormat,
                              int width,
                              int height,
                              boolean scaleHeight)
Save contents of HTML page to a scaled image on disk. NOTE: PNG image creation is less JVM memory intensive.

Parameters:
fileName - File to output.
imageFormat - Output format of the file. (IMAGE_FORMAT_PNG or IMAGE_FORMAT_JPG)
width - Width to scale the page down to.
height - Height of the thumbnail
scaleHeight - If true, scales the entire page into the thumbnail, otherwise scales according to width and clips height.

savePageImageToDiskScaled

int savePageImageToDiskScaled(java.io.File fileName,
                              int imageFormat,
                              int width,
                              int height,
                              boolean scaleHeight,
                              boolean waitForPendingRequests)
Save contents of HTML page to a scaled image on disk. NOTE: PNG image creation is less JVM memory intensive.

Parameters:
fileName - File to output.
imageFormat - Output format of the file. (IMAGE_FORMAT_PNG or IMAGE_FORMAT_JPG)
width - Width to scale the page down to.
height - Height of the thumbnail
scaleHeight - If true, scales the entire page into the thumbnail, otherwise scales according to width and clips height.
waitForPendingRequests - if set to true will wait for all pending requests to complete before saving.

setPrefProperty

void setPrefProperty(java.lang.String pref,
                     boolean onOff)
Sets an optional property of the underlying browser. Available properties are based on the type of browser being used.

Parameters:
pref - The property to set.
onOff - The value to set it to.

setPrefProperty

void setPrefProperty(java.lang.String pref,
                     int intPref)
Sets an optional property of the underlying browser. Available properties are based on the type of browser being used.

Parameters:
pref - The property to set.
intPref - The value to set it to.

setPrefProperty

void setPrefProperty(java.lang.String pref,
                     java.lang.String stringPref)
Sets an optional property of the underlying browser. Available properties are based on the type of browser being used.

Parameters:
pref - The property to set.
stringPref - The value to set it to.

addBrowserListener

void addBrowserListener(BrowserListener listener)
Adds the specified browser listener that will receive browser events from this component. If listener is null, no exception is thrown and no action is performed.

Parameters:
listener - The browser listener to add.
See Also:
removeBrowserListener(BrowserListener)

addJavascriptListener

void addJavascriptListener(JavascriptListener listener)
Adds the specified Javascript listener that will receive Javascript events from this component. If listener is null, no exception is thrown and no action is performed.

Parameters:
listener - The Javascript listener to add.
See Also:
removeJavascriptListener(JavascriptListener)

addNetworkListener

void addNetworkListener(NetworkListener listener)
Adds the specified network listener that will receive network events from this component. If listener is null, no exception is thrown and no action is performed.

Parameters:
listener - The network listener to add.
See Also:
removeNetworkListener(NetworkListener)

addWindowListener

void addWindowListener(WindowListener listener)
Adds the specified window listener that will receive new Window events from this component.

Parameters:
listener - The window listener to add.
See Also:
removeWindowListener(WindowListener)

addPromptListener

void addPromptListener(PromptListener listener)
Adds a PromptListener. This will recieve events when the browser wants to show a dialog box.

Parameters:
listener - the prompt listener to add.
See Also:
removePromptListener(PromptListener)

removeWindowListener

void removeWindowListener(WindowListener listener)
Removes a WindowListener.

Parameters:
listener - the listener to remove.

removeBrowserListener

void removeBrowserListener(BrowserListener listener)
Removes the specified browser listener so that it no longer receives browser events from this component. This method performs no function, nor does it throw an exception, if the listener specified by the argument was not previously added to this component. If either listener is null, or listener has not been previously added as a listener, no exception is thrown and no action is performed.

Parameters:
listener - The browser listener
See Also:
addBrowserListener(BrowserListener)

removeJavascriptListener

void removeJavascriptListener(JavascriptListener listener)
Removes the specified Javascript listener so that it no longer receives Javascript events from this component. This method performs no function, nor does it throw an exception, if the listener specified by the argument was not previously added to this component. If either listener is null, or listener has not been previously added as a listener, no exception is thrown and no action is performed.

Parameters:
listener - The Javascript listener
See Also:
addJavascriptListener(JavascriptListener)

removeNetworkListener

void removeNetworkListener(NetworkListener listener)
Removes the specified network listener so that it no longer receives network events from this component. This method performs no function, nor does it throw an exception, if the listener specified by the argument was not previously added to this component. If either listener is null, or listener has not been previously added as a listener, no exception is thrown and no action is performed.

Parameters:
listener - The network listener
See Also:
addNetworkListener(NetworkListener)

removePromptListener

void removePromptListener(PromptListener listener)
Removes the specified Prompt listener so that it no longer receives browser events from this component. This method performs no function, nor does it throw an exception, if the listener specified by the argument was not previously added to this component. If either listener is null, or listener has not been previously added as a listener, no exception is thrown and no action is performed.

Parameters:
listener - The Prompt listener to remove.

executeScript

void executeScript(java.lang.String javascriptBody)
Executes the specified script on the currently loaded document. Javascript must be enabled for this to work.
This should not be called until after an onDocumentComplete event is fired (in NewtorkListener).

Parameters:
javascriptBody - The script to run.
See Also:
NetworkListener, addNetworkListener(NetworkListener), setJavascriptEnabled(boolean)

executeScriptWithReturn

java.lang.String executeScriptWithReturn(java.lang.String javascriptBody)
Executes the specified script on the currently loaded document. Javascript must be enabled for this to work.
This should not be called until after an onDocumentComplete event is fired (in NewtorkListener).

Returns the result of executing this script as a string
e.g: executing the following script:
" var myVariable='hello';myVariable;"
Will return the string "hello"

Parameters:
javascriptBody - The script to run
See Also:
NetworkListener, addNetworkListener(NetworkListener), setJavascriptEnabled(boolean)

httpPOST

void httpPOST(java.lang.String strURL,
              java.lang.String POSTData)
Load URL with POST String Data

Parameters:
strURL -
POSTData -

httpPOST

void httpPOST(java.lang.String strURL,
              java.io.File file,
              java.lang.String fileVariableName,
              java.lang.String additionalPOSTData)
Load URL with POST String Data and File which should be uploaded Format of additionPOSTData parameter: name=Parameter_name\r\n\r\nParamter_value\r\n where Paramter_name is a form field name and Paramter_value is form field value

Parameters:
strURL -
file -
fileVariableName -
additionalPOSTData -

httpPOST

void httpPOST(java.lang.String strURL,
              java.io.File file,
              java.lang.String fileVariableName)
Load URL with File which should be uploaded

Parameters:
strURL -
file -
fileVariableName -

getBoolPrefProperty

boolean getBoolPrefProperty(java.lang.String propName)
Gets the boolean value of a property.

Parameters:
propName - the name of the property to retrieve.
Returns:
the value of the property.

getIntPrefProperty

int getIntPrefProperty(java.lang.String propName)
Gets the integer value of a property.

Parameters:
propName - the name of the property to retrieve.
Returns:
the value of the property.

getStringPrefProperty

java.lang.String getStringPrefProperty(java.lang.String propName)
Gets the String value of a property.

Parameters:
propName - the name of the property to retrieve.
Returns:
the value of the property.

isCacheDisabled

boolean isCacheDisabled()
Gets the disabled status of the cache.

Returns:
Status of cache disabling. true indicates the cache is disabled.

disableCache

void disableCache()
Disables the cache. If this is called on a browser created with BrowserFactory.spawnInternetExplorer() it must be called directly after spawning the browser. The spawnMozilla version of the method can be called anytime with the effects happening on the next page load.

See Also:
enableCache()

enableCache

void enableCache()
Enables the cache. If this is called on a browser created with BrowserFactory.spawnInternetExplorer() it must be called directly after spawning the browser. The spawnMozilla version of the method can be called anytime with the effects happening on the next page load.

See Also:
disableCache()

emptyCache

void emptyCache()
Removes all cache entries. This includes both memory and disk cache entries.


addBlockedURL

void addBlockedURL(java.lang.String strURL)
Adds URL to the list of blocked URLs (URLs that are not displayed).

Parameters:
strURL - full URL to add to blocked list.
See Also:
removeBlockedURL(String)

removeBlockedURL

void removeBlockedURL(java.lang.String strURL)
Removes a URL from the list of blocked URLs.

Parameters:
strURL - full URL to remove from blocked list.
See Also:
addBlockedURL(String)

getSelectedText

java.lang.String getSelectedText()
Gets the active text selection in the browser.

Returns:
the selected text.

destroy

void destroy()
This functions destroys resources allocated by browser canvas. This is function is not necessary for calling when running in java application, but must be called when destroying an applet.

See Also:
BrowserFactory.destroyBrowser(IBrowserCanvas)

highlightSelectedText

void highlightSelectedText(java.awt.Color colour)
Changes the background color on the current selection to given color.

Parameters:
colour - the colour to use for highlighting.

enableCookies

void enableCookies()
Enables cookies feature.

See Also:
disableCookies()

disableCookies

void disableCookies()
Disable cookies feature.

See Also:
enableCookies()

isCookiesEnabled

boolean isCookiesEnabled()
Gets the on/off status of the cookies feature

Returns:
true if cookies feature is enabled.
See Also:
disableCookies(), enableCookies()

makeImageUrl

java.lang.String makeImageUrl(java.awt.image.BufferedImage img)
Registers this image in wrimage:// protocol.

Parameters:
img - the image.
Returns:
the image URL.
See Also:
removeImage(String)

removeImage

void removeImage(java.lang.String imageID)
Removes a specified image.

Parameters:
imageID - the image ID.
See Also:
makeImageUrl(java.awt.image.BufferedImage)

saveToBufferedImage

java.awt.image.BufferedImage saveToBufferedImage()
Saves the current page to a buffered image.

Returns:
the image.

saveToBufferedImageNoAlpha

java.awt.image.BufferedImage saveToBufferedImageNoAlpha()
Saves the current page to a buffered image without an alpha channel. This is useful for creating JPEG's.

Returns:
the image.

saveToBufferedImage

java.awt.image.BufferedImage saveToBufferedImage(boolean waitForPendingRequests)
Saves the current page to a buffered image.

Parameters:
waitForPendingRequests - if set to true will wait for all pending requests to complete before saving.
Returns:
the image.

saveToBufferedImageNoAlpha

java.awt.image.BufferedImage saveToBufferedImageNoAlpha(boolean waitForPendingRequests)
Saves the current page to a buffered image without an alpha channel.

Parameters:
waitForPendingRequests - if set to true will wait for all pending requests to complete before saving.
Returns:
the image.

getCookie

java.lang.String getCookie(java.lang.String URL)
Gets the specified cookie.

Parameters:
URL -
Returns:
cookie.
See Also:
getCookie(), setCookie(String), setCookie(String, String)

getCookie

java.lang.String getCookie()
Gets the cookie for the currently loaded domain.

Returns:
cookie.
See Also:
getCookie(String), setCookie(String), setCookie(String, String)

getCookieFromHttp

java.lang.String getCookieFromHttp(java.lang.String URL)
Parameters:
URL -
Returns:
The cookie.

setCookie

void setCookie(java.lang.String Value)
Sets the cookie for the currently loaded domain.

Parameters:
Value - the cookie value.
See Also:
getCookie(String)

setCookie

void setCookie(java.lang.String URL,
               java.lang.String Value)
Sets cookie for a given domain.

Parameters:
URL - the domain for the cookie.
Value - the value for the cookie.
See Also:
getCookie(String)

deleteCookies

void deleteCookies()
Deletes stored cookies.


sendKeyPressToElement

void sendKeyPressToElement(int keyCode,
                           int modifiers)
Sends a key event to the currently focused element with the given key code and character code.

Parameters:
keyCode - A key code, selected from the KEY_CODE constants.
modifiers - A key modifier, selected from the KEY_MODIFIER constants.
See Also:
KEY_CODE_BACKSPACE, KEY_CODE_DELETE, KEY_CODE_TAB, KEY_MODIFIER_CTRL_DOWN, KEY_MODIFIER_SHIFT_DOWN

getElementAtCaretPosition

IElement getElementAtCaretPosition(boolean returnTextNodes)
Retrieves the element under the cursor when in edit mode.

Parameters:
returnTextNodes - When called on an IMozillaBrowserCanvas setting this to true will return the text node the cursor is on, otherwise the parent tag. This parameter is ignored if not called on an IMozillaBrowserCanvas.
Returns:
IElement under cursor, or null.
See Also:
setHTMLEditingMode(boolean)

increaseTextZoom

void increaseTextZoom()
Increases the size of text on the page.


decreaseTextZoom

void decreaseTextZoom()
Decreases the size of text on the page.


setSize

void setSize(int width,
             int height)
Sets the page to a set size. Scrollbars will be added if the size is smaller than the total size of the page. A load a new page should be loaded after setting this.

Parameters:
width -
height -

setMinimumWidth

void setMinimumWidth(int width)
Change the minimum width of subsequently rendered pages. The minimum width of the page is analogous to the visible size of a browser window used to display a web page. Although the visible window is a fixed size, the browser can render to a larger virtual window and display a subsection of this using scrollbars. The position of objects (for example, centered images) are relative to the minimum width of the rendered page, not the width of the actual buffer to which a page is rendered. This behaviour is consistent with browsers.

Parameters:
width - The width in pixels.

saveToBufferedImageScaled

java.awt.image.BufferedImage saveToBufferedImageScaled(double scalefactor)
Saves the current page and scales it to a buffered image.

Parameters:
scalefactor - Less than 1.0 and greater than 0.0 to scale down, bigger than 1.0 to scale up.
Returns:
The BufferedImage

saveToBufferedImageScaled

java.awt.image.BufferedImage saveToBufferedImageScaled(double scalefactor,
                                                       boolean waitForPendingRequests)
Saves the current page and scales it to a buffered image.

Parameters:
scalefactor - Less than 1.0 and greater than 0.0 to scale down, bigger than 1.0 to scale up.
waitForPendingRequests - if set to true will wait for all pending requests to complete before saving.
Returns:
The BufferedImage

saveToBufferedImageScaled

java.awt.image.BufferedImage saveToBufferedImageScaled(int width,
                                                       int height,
                                                       boolean scaleheight)
Saves the current page to specified size and returns a BufferedImage.

Parameters:
width - Width to scale the page down to.
height - Height of the thumbnail
scaleheight - If true, scales the entire page into the thumbnail, otherwise scales according to width and clips height.
Returns:
BufferedImage of the thumbnail.

saveToBufferedImageScaledNoAlpha

java.awt.image.BufferedImage saveToBufferedImageScaledNoAlpha(double scalefactor)
Saves the current page and scales it to a buffered image without an alpha channel.

Parameters:
scalefactor - Less than 1.0 and greater than 0.0 to scale down, bigger than 1.0 to scale up.
Returns:
The BufferedImage

saveToBufferedImageScaledNoAlpha

java.awt.image.BufferedImage saveToBufferedImageScaledNoAlpha(double scalefactor,
                                                              boolean waitForPendingRequests)
Saves the current page and scales it to a buffered image without an alpha channel.

Parameters:
scalefactor - Less than 1.0 and greater than 0.0 to scale down, bigger than 1.0 to scale up.
waitForPendingRequests - if set to true will wait for all pending requests to complete before saving.
Returns:
The BufferedImage

saveToBufferedImageScaledNoAlpha

java.awt.image.BufferedImage saveToBufferedImageScaledNoAlpha(int width,
                                                              int height,
                                                              boolean scaleheight)
Saves the current page to specified size and returns a BufferedImage without an alpha channel.

Parameters:
width - Width to scale the page down to.
height - Height of the thumbnail
scaleheight - If true, scales the entire page into the thumbnail, otherwise scales according to width and clips height.
Returns:
BufferedImage of the thumbnail.

saveToBufferedImageScaled

java.awt.image.BufferedImage saveToBufferedImageScaled(int width,
                                                       int height,
                                                       boolean scaleheight,
                                                       boolean waitForPendingRequests)
Saves the current page to specified size and returns a BufferedImage.

Parameters:
width - Width to scale the page down to.
height - Height of the thumbnail
scaleheight - If true, scales the entire page into the thumbnail, otherwise scales according to width and clips height.
waitForPendingRequests - if set to true will wait for all pending requests to complete before saving.
Returns:
BufferedImage of the thumbnail.

saveToBufferedImageScaledNoAlpha

java.awt.image.BufferedImage saveToBufferedImageScaledNoAlpha(int width,
                                                              int height,
                                                              boolean scaleheight,
                                                              boolean waitForPendingRequests)
Saves the current page to specified size and returns a BufferedImage without an alpha channel.

Parameters:
width - Width to scale the page down to.
height - Height of the thumbnail
scaleheight - If true, scales the entire page into the thumbnail, otherwise scales according to width and clips height.
waitForPendingRequests - if set to true will wait for all pending requests to complete before saving.
Returns:
BufferedImage of the thumbnail.

print

void print()
           throws java.awt.print.PrinterException
Print the current rendered document/web-page to the default printer. The output is not scaled to fit the paper size. If the rendered page is wider than the printer page, only that leftmost part of the page that fits on the printer page is printed. If the rendered page is deeper than a single printer page, multiple pages are printed with a subsection of the rendered document/page on each. Page number, date, document/web-page title and name are printed in the header/footer sections of each page. Header and footer information may be adjusted. Note that this method throws a PrinterException for various printer-specific reasons such as printer out of paper, ink, etc.

Throws:
java.awt.print.PrinterException
See Also:
setPrintFooters(String, String), setPrintHeaders(String, String)

print

void print(boolean scaleWidth,
           java.awt.print.PageFormat pf)
           throws java.awt.print.PrinterException
Print the current rendered document/web-page to the default printer, using scaling and page format data. If scaling is enabled, the rendered page is scaled in both dimensions such that the pages fit the width of the printer page. Information about the page orientation and size may be set through the PageFormat parameter. If the rendered page is deeper than a single printer page, multiple pages are printed with a subsection of the rendered document/page on each. Page number, date, document/web-page title and name are printed in the header/footer sections of each page. Header and footer information may be adjusted. Note that this method throws a PrinterException for various printer-specific reasons such as printer out of paper, ink, etc.

Parameters:
scaleWidth - true to scale the image to fit the paper width.
pf - a java PageFormat object with details about the page format. If null, the PageFormat object for the default printer is used.
Throws:
java.awt.print.PrinterException
See Also:
setPrintFooters(String, String), setPrintHeaders(String, String)

getPrintable

java.awt.print.Printable getPrintable(boolean scaled)
Get a Printable object that is used with Java printing. The object returned implements the Printable interface to provide printing capability. This Printable object may be used to print, as shown in the example below.

 PrinterJob pj = PrinterJob.getPrinterJob();
 pj.setPrintable( getPrintable( true ) );  // use a printable object that scales the page 
 pj.print();
 

Parameters:
scaled - true if the document/web-page is to be scaled to the paper width when printing.
Returns:
A printable object for the current browser.

setPrintHeaders

void setPrintHeaders(java.lang.String leftHeader,
                     java.lang.String rightHeader)
Set the format of the page header for print output. The header is divided into a left and right section, with each section containing user-configurable information about the document/web-page. The format of the header section is specified in the form of a string with the following special codes replaced with the listed contents...

Parameters:
leftHeader - String with optional special codes, specifying the header left hand section. May be null.
rightHeader - String with optional special codes, specifying the header right hand section. May be null.
See Also:
print(), print(boolean, PageFormat), setPrintFooters(String, String)

setPrintFooters

void setPrintFooters(java.lang.String leftFooter,
                     java.lang.String rightFooter)
Set the format of the page footer for print output. The header is divided into a left and right section, with each section containing user-configurable information about the document/web-page. The format of the header section is specified in the form of a string with the following special codes replaced with the listed contents...

Parameters:
leftHeader - String with optional special codes, specifying the footer left hand section. May be null.
rightHeader - String with optional special codes, specifying the footer right hand section. May be null.
See Also:
print(), print(boolean, PageFormat), setPrintFooters(String, String)

savePageSectionToBufferedImage

java.awt.image.BufferedImage savePageSectionToBufferedImage(int x,
                                                            int y,
                                                            int width,
                                                            int height,
                                                            boolean breakText)
Grabs a section of the webpage and returns a BufferedImage.

Parameters:
x -
y -
width -
height -
breakText - will not return a section with horizontally cut off text if this is false.
Returns:
BufferedImage
See Also:
setPrintHeaders(String, String)

savePageSectionToBufferedImage

java.awt.image.BufferedImage savePageSectionToBufferedImage(int x,
                                                            int y,
                                                            int width,
                                                            int height,
                                                            boolean breakText,
                                                            boolean waitForPendingRequests)
Grabs a section of the webpage and returns a BufferedImage.

Parameters:
x -
y -
width -
height -
breakText - will not return a section with horizontally cut off text if this is false.
waitForPendingRequests - if set to true will wait for all pending requests to complete before saving.
Returns:
BufferedImage
See Also:
setPrintHeaders(String, String)

getPageSize

java.awt.Dimension getPageSize()
Get the total size in pixels of the current loaded page.

Returns:
the size in pixels.

writePageImage

void writePageImage(java.io.OutputStream out,
                    int imageFormat)
Save contents of HTML page to an image. NOTE: PNG image creation is less JVM memory intensive.

Parameters:
fileName - File to output.
imageFormat - Output format of the file. (IMAGE_FORMAT_PNG or IMAGE_FORMAT_JPG)

writePageImage

void writePageImage(java.io.OutputStream out,
                    int imageFormat,
                    boolean waitForPendingRequests)
Save contents of HTML page to an image. NOTE: PNG image creation is less JVM memory intensive.

Parameters:
fileName - File to output.
imageFormat - Output format of the file. (IMAGE_FORMAT_PNG or IMAGE_FORMAT_JPG)
waitForPendingRequests - if set to true will wait for all pending requests to complete before saving.

writePageImageScaled

void writePageImageScaled(java.io.OutputStream out,
                          int imageFormat,
                          double scalefactor)
Save contents of HTML page to a scaled image. NOTE: PNG image creation is less JVM memory intensive.

Parameters:
fileName - File to output.
imageFormat - Output format of the file. (IMAGE_FORMAT_PNG or IMAGE_FORMAT_JPG)
scalefactor - Less than 1.0 and greater than 0.0 to scale down, bigger than 1.0 to scale up.

writePageImageScaled

void writePageImageScaled(java.io.OutputStream out,
                          int imageFormat,
                          double scalefactor,
                          boolean waitForPendingRequests)
Save contents of HTML page to a scaled image. NOTE: PNG image creation is less JVM memory intensive.

Parameters:
fileName - File to output.
imageFormat - Output format of the file. (IMAGE_FORMAT_PNG or IMAGE_FORMAT_JPG)
scalefactor - Less than 1.0 and greater than 0.0 to scale down, bigger than 1.0 to scale up.
waitForPendingRequests - if set to true will wait for all pending requests to complete before saving.

writePageImageScaled

void writePageImageScaled(java.io.OutputStream out,
                          int imageFormat,
                          int width,
                          int height,
                          boolean scaleHeight)
Save contents of HTML page to a scaled image. NOTE: PNG image creation is less JVM memory intensive.

Parameters:
fileName - File to output.
imageFormat - Output format of the file. (IMAGE_FORMAT_PNG or IMAGE_FORMAT_JPG)
width - Width to scale the page down to.
height - Height of the thumbnail
scaleHeight - If true, scales the entire page into the thumbnail, otherwise scales according to width and clips height.

writePageImageScaled

void writePageImageScaled(java.io.OutputStream out,
                          int imageFormat,
                          int width,
                          int height,
                          boolean scaleHeight,
                          boolean waitForPendingRequests)
Save contents of HTML page to a scaled image. NOTE: PNG image creation is less JVM memory intensive.

Parameters:
fileName - File to output.
imageFormat - Output format of the file. (IMAGE_FORMAT_PNG or IMAGE_FORMAT_JPG)
width - Width to scale the page down to.
height - Height of the thumbnail
scaleHeight - If true, scales the entire page into the thumbnail, otherwise scales according to width and clips height.
waitForPendingRequests - if set to true will wait for all pending requests to complete before saving.

enableImageLoading

void enableImageLoading(boolean enable)
Allow images to load.

Parameters:
enable - true to load images, false to disable them. This is true by default.

setMaxRenderSize

void setMaxRenderSize(int width,
                      int height)
Sets the maximum size of the buffer that the page can render to. The default size is 2000,20000 (~153Mb worst case scenario). These values clip the webpage whereas setSize(int,int) sets the widow size.

Parameters:
width - maximum width.
height - maximum height.

getMaxRenderSize

java.awt.Dimension getMaxRenderSize()
Gets the current maximum buffer size that pages can render to.

Returns:
maximum buffer size.

invokeLater

void invokeLater(java.lang.Runnable r)
Runs the given Runnable on the WebRenderer thread. By running a group of browser commands (such as DOM) at once you can speed up execution speed significantly.

Parameters:
r -

invokeAndWait

void invokeAndWait(java.lang.Runnable r)
Runs the given Runnable on the WebRenderer thread and waits until completion. By running a group of browser commands (such as DOM) at once you can speed up execution speed significantly.

Parameters:
r -