Closed modlenine closed 5 years ago
Hello modlenine,
Can you post your code (except your keys)?
This code .
`<?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('my_project_public_id','my_project_secret_key');
// file var keeps info about server file id, name... // it can be used latter to cancel file $file = $myTask->addFile('../Powerpoint2010.pdf');
// set mode to text $myTask->setMode("text");
// set the text $myTask->setText("watermark text");
// process files $myTask->execute();
// and finally download the unlocked file. If no path is set, it will be downloaded on current folder $myTask->download();`
Can you put your code inside a try/catch as shown in "try_catch_sample.php"? and post the full output from there...i tested the same code and get not error...
Note: Did you check you have read permissions for php on this pdf file?
Fatal error: Uncaught Ilovepdf\Exceptions\UploadException: Upload error in D:\xampp\htdocs\ilovepdf-php\src\Ilovepdf.php:191 Stack trace: #0 D:\xampp\htdocs\ilovepdf-php\src\Task.php(191): Ilovepdf\Ilovepdf->sendRequest('post', 'upload', Array) #1 D:\xampp\htdocs\ilovepdf-php\src\Task.php(156): Ilovepdf\Task->uploadFile('g27d4mrsg3ztmnz...', '../Powerpoint20...') #2 D:\xampp\htdocs\ilovepdf-php\samples\watermark_basic.php(15): Ilovepdf\Task->addFile('../Powerpoint20...') #3 {main} thrown in D:\xampp\htdocs\ilovepdf-php\src\Ilovepdf.php on line 191