-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
78 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
//include the autoloader | ||
require_once('../vendor/autoload.php'); | ||
//if manual installation has been used comment line that requires the autoload and uncomment this line: | ||
//require_once('../init.php'); | ||
|
||
use Ilovepdf\WatermarkTask; | ||
|
||
// you can call task class directly | ||
// to get your key pair, please visit https://developer.ilovepdf.com/user/projects | ||
$myTask = new WatermarkTask('project_public_id','project_secret_key'); | ||
|
||
// file var keeps info about server file id, name... | ||
// it can be used latter to cancel file | ||
$file = $myTask->addFile('/path/to/file/document.pdf'); | ||
|
||
$watermakImage = $myTask->addElementFile('/path/to/image/image.png'); | ||
|
||
// set mode to image | ||
$myTask->setMode("image"); | ||
|
||
// set the image | ||
$myTask->setImageFile($watermakImage); | ||
|
||
// process files | ||
$myTask->execute(); | ||
|
||
// and finally download the unlocked file. If no path is set, it will be downloaded on current folder | ||
$myTask->download(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters