Skip to content

Commit

Permalink
added test files and examples
Browse files Browse the repository at this point in the history
  • Loading branch information
pvrpccc committed Jan 10, 2017
1 parent 4c39009 commit 034ced7
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/example.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php
$ch = curl_init("http://localhost:9021/watermark");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, [
'watermark' => new \CurlFile(__DIR__.'/watermark.pdf','application/pdf','watermark.pdf'),
'pdf-to-watermark' => new \CurlFile(__DIR__.'/pdf-to-watermark.pdf','application/pdf','pdf-to-watermark.pdf')
]);
$result = curl_exec($ch);
file_put_contents("watermarked.pdf", $result);
1 change: 1 addition & 0 deletions test/example.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
curl -F "[email protected]" -F "[email protected]" http://localhost:9021/watermark > watermarked.pdf
Binary file added test/pdf-to-watermark.pdf
Binary file not shown.
Binary file added test/watermark.pdf
Binary file not shown.

0 comments on commit 034ced7

Please sign in to comment.