AddWatermark is a library written in pure PHP that provides class that allows you to add watermark text to pdf or image files.
AddWatermark requires the following:
- PHP 8.1+
- GD extension
AddWatermark is installed via Composer. To add a dependency to AddWatermark in your project, either
Run the following to use the latest stable version
composer require tuckdesign/add-watermark
or if you want the latest unreleased version
composer require tuckdesign/add-watermark
The following is a basic usage example of the AddWatermark library.
<?php
require_once 'vendor/autoload.php';
$addWatermark = new \tuckdesign\AddWatermark('myfile.pdf', 'CONFIDENTIAL', 100, 100, 40, 45);
$newFile = $addWatermark->getOutputFile();