Get a Free Trial

GrabzItClient with Java

Download
Java API

Description

This class handles all communication with the GrabzIt screenshot web services.

Public Methods

GrabzItFile GetResult(String id)

This method returns the screenshot itself. If nothing is returned then something has gone wrong or the screenshot is not ready yet.

Parameters

Return Value

GrabzItFile object


URLToAnimation(String url, AnimationOptions options)

Specifiy the URL of the online video that should be converted into a animated GIF.

Parameters

Return Value

void

AnimationOptions

The class represents all of the options available when creating an animated GIF.

Public Properties


URLToImage(String url, ImageOptions options)

Specifies the URL that should be converted into a image screenshot.

Parameters

Return Value

void

HTMLToImage(String html, ImageOptions options)

Specifies the HTML that should be converted into a image.

Parameters

Return Value

void

FileToImage(String path, ImageOptions options)

Specifies a HTML file that should be converted into a image.

Parameters

Return Value

void

ImageOptions

The class represents all of the options available when creating image captures.

Public Properties

Public Methods


URLToVideo(String url, VideoOptions options)

Specifies the URL that should be converted into a video.

Parameters

Return Value

void

HTMLToVideo(String html, VideoOptions options)

Specifies the HTML that the video should be captured from.

Parameters

Return Value

void

FileToVideo(String path, VideoOptions options)

Specifies a HTML file that should be converted into a video.

Parameters

Return Value

void

VideoOptions

The class represents all of the options available when creating a video of a webpage.

Public Properties

Public Methods


URLToRenderedHTML(String url, HTMLOptions options)

Specifies the URL that should be converted into rendered HTML.

Parameters

Return Value

void

HTMLToRenderedHTML(string html, HTMLOptions options)

Specifies the HTML that should be converted into rendered HTML.

Parameters

Return Value

void

FileToRenderedHTML(string path, HTMLOptions options)

Specifies a HTML file that should be converted into rendered HTML.

Parameters

Return Value

void

HTMLOptions

The class represents all of the options available when creating rendered HTML captures.

Public Properties

Public Methods


URLToPDF(String url, PDFOptions options)

Specifies the URL that should be converted into a PDF.

Parameters

Return Value

void

HTMLToPDF(String html, PDFOptions options)

Specifies the HTML that should be converted into a PDF.

Parameters

Return Value

void

FileToPDF(String path, PDFOptions options)

Specifies a HTML file that should be converted into a PDF.

Parameters

Return Value

void

PDFOptions

The class represents all of the options available when creating PDF captures.

Public Properties

Public Methods


URLToDOCX(String url, DOCXOptions options)

Specifies the URL that should be converted into a DOCX.

Parameters

Return Value

void

HTMLToDOCX(String html, DOCXOptions options)

Specifies the HTML that should be converted into a DOCX.

Parameters

Return Value

void

FileToDOCX(String path, DOCXOptions options)

Specifies a HTML file that should be converted into a DOCX.

Parameters

Return Value

void

DOCXOptions

The class represents all of the options available when creating DOCX captures.

Public Properties

Public Methods


URLToTable(String url, TableOptions options)

Specifies the URL that the HTML tables should be extracted from.

Parameters

Return Value

void

HTMLToTable(String html, TableOptions options)

Specifies the HTML that the HTML tables should be extracted from.

Parameters

Return Value

void

FileToTable(String path, TableOptions options)

Specifies a HTML file that the HTML tables should be extracted from.

Parameters

Return Value

void

TableOptions

The class represents all of the options available when converting HTML tables to CSV, XLSX or JSON.

Public Properties

Public Methods


Save()

Save the result asynchronously and returns a unique identifier, which can be used to get the screenshot with the GetResult method.

Return Value

The unique identifier of the screenshot otherwise if a error has occured an exception is thrown. This can be used to get the screenshot with the GetResult method


This is the recommended method of saving a file

Save(String callBackURL)

Save the result asynchronously and returns a unique identifier, which can be used to get the screenshot with the GetResult method.

Parameters

Return Value

The unique identifier of the screenshot otherwise if a error has occured an exception is thrown. This can be used to get the screenshot with the GetResult method

Warning this method is synchronous so will cause a application to pause while the result is processed

GrabzItFile SaveTo()

Save the result synchronously to a GrabzItFile object.

Return Value

GrabzItFile object


Warning this method is synchronous so will cause a application to pause while the result is processed

SaveTo(String saveToFile)

Save the result synchronously to a file.

Parameters

Return Value

returns the true if it is successful otherwise it throws an exception.


Status GetStatus(String id)

Get the current status of a GrabzIt screenshot.

Parameters

Return Value

Status object


GrabzItCookie[] GetCookies(String domain)

Get all the cookies that GrabzIt is using for a particular domain. This may include user defined cookies as well.

Parameters

Return Value

GrabzItCookie array


SetCookie(String name, String domain, String value, String path, boolean httponly, Date expires)

Sets a new custom cookie on GrabzIt, if the custom cookie has the same name and domain as a global cookie the global cookie is overridden.

This can be useful if a websites functionality is controlled by cookies.

Parameters

Return Value

True if the cookie is successfully set, otherwise false


DeleteCookie(String name, String domain)

Delete a custom cookie or block a global cookie from being used

Parameters

Return Value

True if the cookie is successfully deleted, otherwise false


WaterMark[] GetWaterMarks()

Get all your uploaded custom watermarks

Return Value

WaterMark array


WaterMark GetWaterMark(String identifier)

Return your custom watermarks that matches the specified identifier

Parameters

Return Value

WaterMark object


AddWaterMark(String identifier, String path, HorizontalPosition xpos, VerticalPosition ypos)

Add a new custom watermark

Parameters

Return Value

returns true if the watermark was successfully set


DeleteWaterMark(String identifier)

Delete a custom watermark

Parameters

Return Value

returns true if the watermark was successfully deleted


SetLocalProxy(String proxyUrl)

This method enables a local proxy server to be used for all requests.

Parameters


UseSSL(boolean value)

Specifies if requests to GrabzIt's API should use SSL

Parameters


String CreateEncryptionKey()

Create a cryptographically secure base 64 encryption key, 44 characters long.


Decrypt(String path, String key)

Decrypt an encrypted capture using the provided encryption key.

Parameters


GrabzItFile Decrypt(GrabzItFile file, String key)

Decrypt an encrypted capture using the provided encryption key.

Parameters


byte[] Decrypt(byte[] data, String key)

Decrypt an encrypted capture using the provided encryption key.

Parameters


Enums

ImageFormat

This enum comprises of the following values.


BrowserType

This enum comprises of the following values.


Country

This enum comprises of the following values.


PageSize

This enum comprises of the following values.


PageOrientation

This enum comprises of the following values.


CSSMediaType

This enum comprises of the following values.


TableFormat

This enum comprises of the following values.


HorizontalPosition

This enum comprises of the following values.


VerticalPosition

This enum comprises of the following values.


Result Classes

Cookie

Public Properties

GrabzItFile

Public Methods

Status

The class representing the current status of the screenshot.

Public Methods

WaterMark

This class represents the custom watermarks stored in GrabzIt

Public Methods