-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathhome.html
40 lines (40 loc) · 1.26 KB
/
home.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<html>
<head>
<style type="text/css">
body{
background-color:orange;
color:brown;
}
pre {
background-color:#DFDFDF;
color:#666;
padding:30px;
marging:10px;
}
</style>
</head>
<body>
<h1>Instructions</h1>
<p>In order to watermark a pdf, send two PDF files to /watermark, one with fieldname
watermark and one with fieldname pdf-to-watermark. The watermark pdf will get
stamped on each page of the pdf-to-watermark pdf and the resulting PDF
streamed back to the client.</p>
<h2>CURL Example</h2>
<pre>curl -F "[email protected]" -F "[email protected]" http://localhost:@PORT/watermark > watermarked.pdf</pre>
<h2>PHP Example</h2>
<pre>
<?php
$ch = curl_init("http://localhost:@PORT/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','my.pdf')
]);
$result = curl_exec($ch);
file_put_contents("watermarked.pdf", $result);
</pre>
<h1>Background Info</h1>
<p>This system is using pdftk as the engine to support this function.</p>
</body>
</html>