Add a watermark to a screenshot with PHP
By default GrabzIt adds the 'GrabzIt' watermark onto screenshots, animated GIF's and PDF's created with a free package. However GrabzIt also enables developers on any paid package to define thier own custom watermarks. These watermarks can be added to image screenshots, PDF screenshots and animated GIF's.
A custom watermark is definined by setting an identifier, along with the file path of the watermark image that is to be uploaded, as well as the position where the watermark should appear on the page. How the position of the watermark is defined and more is specified in the AddWatermark documentation.
$grabzIt->AddWaterMark('DummyWaterMark_TopRight', 'watermark.png', 2, 0);
Now whenever the
DummyWaterMark_TopRight identifier is passed to the
setCustomWaterMarkId method of the GrabzItAnimationOptions, GrabzItImageOptions or GrabzItPDFOptions classes the definied watermark will automatically be placed in the top right of the image or PDF document respectivley.
To read all of your current custom watermarks call the following method.
$watermarks = $grabzIt->GetWaterMarks();
To delete a watermark simply call the the DeleteWaterMark method with the identifier of the watermark you wish to delete.
As watermarks are cached for a short while in the GrabzIt system try to use a different watermark identifier to one that has just been deleted to avoid the cached watermark being re-used.
GrabzIt also provides several special inbuilt watermarks, which can be passed to the
setCustomWaterMarkId method of the GrabzItAnimationOptions, GrabzItImageOptions or GrabzItPDFOptions classes, these include watermarks for adding timestamps, text, counters and browser windows to captures.