Get a Free Trial

Add a watermark to a screenshot with Perl

DownloadTechnical Information
Perl API

By default GrabzIt adds the 'GrabzIt' watermark to screenshots created with the free package. However GrabzIt now allows developers on any paid package to define thier own custom watermarks. These watermarks can be added to images, PDF's', videos 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.

$grabzIt->AddWaterMark('DummyWaterMark_TopRight', 'watermark.png', 2, 0);

Now whenever the DummyWaterMark_TopRight identifier is passed to the customWaterMarkId method of the GrabzItAnimationOptions, GrabzItImageOptions, GrabzItVideoOptions 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()};

foreach $watermark (@watermarks)
{
    print $watermark->getIdentifier();
}

To delete a watermark simply call the the DeleteWaterMark method with the identifier of the watermark you wish to delete.

$grabzIt->DeleteWaterMark('DummyWaterMark_TopRight');

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.

Special Watermarks

GrabzIt also provides several special watermarks, which can be passed to the customWaterMarkId method of the GrabzItAnimationOptions, GrabzItImageOptions, GrabzItVideoOptions or GrabzItPDFOptions classes, these include watermarks for adding timestamps, text, counters and browser windows to captures.