Advanced Screenshot Features with PHP
GrabzIt's PHP API is highly customizable and is able to integrate tightly into your application. It exposes a lot of the inner workings of GrabzIt so you can customize how you use GrabzIt as much as possible. Two examples of this is checking the status of existing screenshots and setting the cookies that GrabzIt will use when taking screenshots or capturing content.
Use the GetStatus method to allow your app to check the status of a screenshot, perhaps to see if it is still processing or if it is cached and ready to be used.
$status = $grabzIt.GetStatus(screenShotId);
// screenshot has not yet been processed
// screenshot is still cached by GrabzIt
// screenshot is no longer on GrabzIt
// Perhaps output status message?
// gets an array of cookies for google.com
$cookies = $grabzIt->GetCookies("google.com");
// sets a cookie for the google.com domain
$grabzIt->SetCookie("MyCookie", "google.com", "Any Value You Like");
// deletes the previously set cookie
Display a Capture without Downloading
While we recommend that you download a capture to a web server before displaying it. You can also display any type of capture in a user's browser without downloading it onto your web server. However for this technique to work the user will have to wait for the capture to complete.
Once completed you can send the bytes of the capture returned by the SaveTo method to the response along with the correct mime type.
As you can see in the above example there is no filename being passed to the SaveTo method which makes the method return the contents of the capture.