-
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
Aleix Cabistany
authored and
Aleix Cabistany
committed
Mar 21, 2017
1 parent
3aa9d7d
commit 34ae32c
Showing
23 changed files
with
476 additions
and
12 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,30 @@ | ||
<?php | ||
//include the autoloader | ||
require_once('../vendor/autoload.php'); | ||
|
||
use Ilovepdf\CompressTask; | ||
|
||
|
||
//you can call task class directly | ||
$myTask = new CompressTask("PUBLIC_KEY", "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'); | ||
|
||
// we can set rotate to file | ||
$file->setRotation(90); | ||
|
||
// set compression level | ||
$myTask->setCompressionLevel('extreme'); | ||
|
||
// and set name for output file. | ||
// the task will set the correct file extension for you. | ||
$myTask->setOutputFilename('lowlow_compression'); | ||
|
||
// process files | ||
// time var will have info about time spent in process | ||
$time = $myTask->execute(); | ||
|
||
// and finally download file. If no path is set, it will be donwloaded on current folder | ||
$myTask->download('path/to/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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
//include the autoloader | ||
require_once('../vendor/autoload.php'); | ||
|
||
use Ilovepdf\CompressTask; | ||
|
||
|
||
//you can call task class directly | ||
$myTask = new CompressTask("PUBLIC_KEY", "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'); | ||
|
||
// process files | ||
// time var will have info about time spent in process | ||
$time = $myTask->execute(); | ||
|
||
// and finally download file. If no path is set, it will be donwloaded 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
//include the autoloader | ||
require_once('../vendor/autoload.php'); | ||
|
||
use Ilovepdf\Ilovepdf; | ||
|
||
|
||
// start the manager classy | ||
$ilovepdf = new Ilovepdf("PUBLIC_KEY", "SECRET_KEY"); | ||
|
||
// and get the task tool | ||
$myTask = $ilovepdf->newTask('merge'); | ||
|
||
// file var keeps info about server file id, name... | ||
// it can be used latter to cancel a specific file | ||
$fileA = $myTask->addFile('/path/to/file/document_a.pdf'); | ||
$fileB = $myTask->addFile('/path/to/file/document_b.pdf'); | ||
|
||
// set compression level | ||
$myTask->setCompressionLevel('extreme'); | ||
|
||
// and set name for output file. | ||
// the task will set the correct file extension for you. | ||
$myTask->setOutputFilename('merged_filename'); | ||
|
||
// process files | ||
// time var will have info about time spent in process | ||
$time = $myTask->execute(); | ||
|
||
// and finally download file. If no path is set, it will be downloaded on current folder | ||
$myTask->download('path/to/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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
//include the autoloader | ||
require_once('../vendor/autoload.php'); | ||
|
||
use Ilovepdf\Ilovepdf; | ||
|
||
|
||
// start the manager classy | ||
$ilovepdf = new Ilovepdf("PUBLIC_KEY", "SECRET_KEY"); | ||
|
||
// and get the task tool | ||
$myTask = $ilovepdf->newTask('merge'); | ||
|
||
// file var keeps info about server file id, name... | ||
// it can be used latter to cancel a specific file | ||
$fileA = $myTask->addFile('/path/to/file/document_a.pdf'); | ||
$fileB = $myTask->addFile('/path/to/file/document_b.pdf'); | ||
|
||
// process files | ||
// time var will have info about time spent in process | ||
$time = $myTask->execute(); | ||
|
||
// and finally download 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?php | ||
//include the autoloader | ||
require_once('../vendor/autoload.php'); | ||
|
||
use Ilovepdf\RepairTask; | ||
|
||
|
||
//you can call task class directly | ||
$myTask = new RepairTask("PUBLIC_KEY", "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'); | ||
|
||
|
||
// and set name for output file. | ||
// the task will set the correct file extension for you. | ||
$myTask->setOutputFilename('repaired_file'); | ||
|
||
// process files | ||
// time var will have info about time spent in process | ||
$time = $myTask->execute(); | ||
|
||
// and finally download file. If no path is set, it will be donwloaded on current folder | ||
$myTask->download('path/to/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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
//include the autoloader | ||
require_once('../vendor/autoload.php'); | ||
|
||
use Ilovepdf\RepairTask; | ||
|
||
|
||
//you can call task class directly | ||
$myTask = new RepairTask("PUBLIC_KEY", "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'); | ||
|
||
// process files | ||
// time var will have info about time spent in process | ||
$time = $myTask->execute(); | ||
|
||
// and finally download file. If no path is set, it will be donwloaded 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php | ||
//include the autoloader | ||
require_once('../vendor/autoload.php'); | ||
|
||
use Ilovepdf\RotateTask; | ||
|
||
|
||
//you can call task class directly | ||
$myTask = new RotateTask("PUBLIC_KEY", "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'); | ||
|
||
// set the rotation, in degrees | ||
$file->setRotation(90); | ||
|
||
// and set name for output file. | ||
// the task will set the correct file extension for you. | ||
$myTask->setOutputFilename('rotated_file'); | ||
|
||
// process files | ||
// time var will have info about time spent in process | ||
$time = $myTask->execute(); | ||
|
||
// and finally download file. If no path is set, it will be donwloaded on current folder | ||
$myTask->download('path/to/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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php | ||
//include the autoloader | ||
require_once('../vendor/autoload.php'); | ||
|
||
use Ilovepdf\RotateTask; | ||
|
||
|
||
//you can call task class directly | ||
$myTask = new RotateTask("PUBLIC_KEY", "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'); | ||
|
||
// set the rotation, in degrees | ||
$file->setRotation(90); | ||
|
||
// process files | ||
// time var will have info about time spent in process | ||
$time = $myTask->execute(); | ||
|
||
// and finally download file. If no path is set, it will be donwloaded 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
//include the autoloader | ||
require_once('../vendor/autoload.php'); | ||
|
||
use Ilovepdf\Ilovepdf; | ||
use Ilovepdf\SplitTask; | ||
|
||
// start the manager classy | ||
$ilovepdf = new Ilovepdf("PUBLIC_KEY", "SECRET_KEY"); | ||
// and get the task tool | ||
$myTask = $ilovepdf->newTask('split'); | ||
|
||
// or you can call task class directly, this set the same tool as before | ||
$myTask = new SplitTask("PUBLIC_KEY", "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'); | ||
|
||
// set ranges to split the document | ||
$myTask->setRanges("2-4,6-8"); | ||
|
||
// and set name for output file. | ||
// in this case it will output a zip file, so we set the package name. | ||
$myTask->setPackagedFilename('split_documents'); | ||
|
||
// and name for splitted document (inside the zip file) | ||
$myTask->setOutputFilename('split'); | ||
|
||
// process files | ||
// time var will have info about time spent in process | ||
$time = $myTask->execute(); | ||
|
||
// and finally download file. If no path is set, it will be donwloaded on current folder | ||
$myTask->download('path/to/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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?php | ||
//include the autoloader | ||
require_once('../vendor/autoload.php'); | ||
|
||
use Ilovepdf\Ilovepdf; | ||
use Ilovepdf\SplitTask; | ||
|
||
// start the manager classy | ||
$ilovepdf = new Ilovepdf("PUBLIC_KEY", "SECRET_KEY"); | ||
// and get the task tool | ||
$myTask = $ilovepdf->newTask('split'); | ||
|
||
// or you can call task class directly, this set the same tool as before | ||
$myTask = new SplitTask("PUBLIC_KEY", "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'); | ||
|
||
// set ranges to split the document | ||
$myTask->setRanges("2-4,6-8"); | ||
|
||
// set we want splitted files to be merged in new one | ||
$myTask->setMergeAfter(true); | ||
|
||
// and name for merged document | ||
$myTask->setOutputFilename('split'); | ||
|
||
// process files | ||
// time var will have info about time spent in process | ||
$time = $myTask->execute(); | ||
|
||
// and finally download file. If no path is set, it will be donwloaded on current folder | ||
$myTask->download('path/to/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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php | ||
//include the autoloader | ||
require_once('../vendor/autoload.php'); | ||
|
||
use Ilovepdf\Ilovepdf; | ||
use Ilovepdf\SplitTask; | ||
|
||
// or you can call task class directly, this set the same tool as before | ||
$myTask = new SplitTask("PUBLIC_KEY", "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'); | ||
|
||
// set ranges to split the document | ||
$myTask->setRanges("2-4,6-8"); | ||
|
||
// process files | ||
// time var will have info about time spent in process | ||
$time = $myTask->execute(); | ||
|
||
// and finally download file. If no path is set, it will be donwloaded 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php | ||
//include the autoloader | ||
require_once('../vendor/autoload.php'); | ||
|
||
use Ilovepdf\UnlockTask; | ||
|
||
|
||
//you can call task class directly | ||
$myTask = new UnlockTask("PUBLIC_KEY", "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'); | ||
|
||
// set the password witch the document is locked | ||
$file->setPassword('test'); | ||
|
||
// and set name for output file. | ||
// the task will set the correct file extension for you. | ||
$myTask->setOutputFilename('unlocked'); | ||
|
||
// process files | ||
// time var will have info about time spent in process | ||
$time = $myTask->execute(); | ||
|
||
// and finally download the unlocked file. If no path is set, it will be donwloaded on current folder | ||
$myTask->download('path/to/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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php | ||
//include the autoloader | ||
require_once('../vendor/autoload.php'); | ||
|
||
use Ilovepdf\UnlockTask; | ||
|
||
|
||
//you can call task class directly | ||
$myTask = new UnlockTask("PUBLIC_KEY", "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'); | ||
|
||
// set the password witch the document is locked | ||
$file->setPassword('test'); | ||
|
||
// process files | ||
// time var will have info about time spent in process | ||
$time = $myTask->execute(); | ||
|
||
// and finally download the unlocked file. If no path is set, it will be donwloaded on current folder | ||
$myTask->download(); |
Oops, something went wrong.