Get a Free Trial

GrabzIt Client with PHP

Download
PHP API

Description

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

Public Methods

GetResult($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

The capture


URLToAnimation($url, $options = null)

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

Parameters

Return Value

void

GrabzItAnimationOptions

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

Public Properties


URLToImage($url, $options = null)

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

Parameters

Return Value

void

HTMLToImage($html, $options = null)

Specifies the HTML that should be converted into a image.

Parameters

Return Value

void

FileToImage($path, $options = null)

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

Parameters

Return Value

void

GrabzItImageOptions

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

Public Properties

Public Methods


URLToVideo($url, $options = null)

Specifies the URL that should be converted into a video.

Parameters

Return Value

void

HTMLToVideo($html, $options = null)

Specifies the HTML that the video should be captured from.

Parameters

Return Value

void

FileToVideo($path, $options = null)

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

Parameters

Return Value

void

GrabzItVideoOptions

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

Public Properties

Public Methods


URLToRenderedHTML($url, $options = null)

Specifies the URL that should be converted into rendered HTML.

Parameters

Return Value

void

HTMLToRenderedHTML($html, $options = null)

Specifies the HTML that should be converted into rendered HTML.

Parameters

Return Value

void

FileToRenderedHTML($path, $options = null)

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

Parameters

Return Value

void

GrabzItHTMLOptions

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

Public Properties

Public Methods


URLToPDF($url, $options = null)

Specifies the URL that should be converted into a PDF.

Parameters

Return Value

void

HTMLToPDF($html, $options = null)

Specifies the HTML that should be converted into a PDF.

Parameters

Return Value

void

FileToPDF($path, $options = null)

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

Parameters

Return Value

void

GrabzItPDFOptions

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

Public Properties

Public Methods


URLToDOCX($url, $options = null)

Specifies the URL that should be converted into a DOCX.

Parameters

Return Value

void

HTMLToDOCX($html, $options = null)

Specifies the HTML that should be converted into a DOCX.

Parameters

Return Value

void

FileToDOCX($path, $options = null)

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

Parameters

Return Value

void

GrabzItDOCXOptions

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

Public Properties

Public Methods


URLToTable($url, $options = null)

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

Parameters

Return Value

void

HTMLToTable($html, $options = null)

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

Parameters

Return Value

void

FileToTable($path, $options = null)

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

Parameters

Return Value

void

GrabzItTableOptions

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

Public Properties

Public Methods


Save($callBackURL = null)

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

SaveTo()

Save the result synchronously to a variable containing the screenshot byte data.

Return Value

returns the byte data of the file if successful otherwise it throws an exception.


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

SaveTo($saveToFile)

Save the result synchronously to a file.

Parameters

Return Value

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


GetStatus($id)

Get the current status of a GrabzIt screenshot.

Parameters

Return Value

GrabzItStatus object


GetCookies($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($name, $domain, $value = "", $path = "/", $httponly = false, $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($name, $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


GetWaterMarks()

Get your uploaded custom watermarks

Return Value

GrabzItWaterMark array


GetWaterMark($identifier)

Return your custom watermarks that matches the specified identifier

Parameters

Return Value

GrabzItWaterMark


AddWaterMark($identifier, $path, $xpos, $ypos)

Add a new custom watermark

Parameters

Return Value

returns true if the watermark was successfully set


DeleteWaterMark($identifier)

Delete a custom watermark

Parameters

Return Value

returns true if the watermark was successfully deleted


SetLocalProxy($proxyUrl)

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

Parameters


UseSSL($value)

Specifies if requests to GrabzIt's API should use SSL or not

Parameters


CreateEncryptionKey()

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


Decrypt($data, $key)

Decrypt an encrypted capture using the provided encryption key.

Parameters


DecryptFile($path, $key)

Decrypt an encrypted capture using the provided encryption key.

Parameters


Result Classes

GrabzItCookie

Public Properties

GrabzItStatus

The class representing the current status of the screenshot.

Public Properties

GrabzItWaterMark

This class represents the custom watermarks stored in GrabzIt

Public Properties