-
Notifications
You must be signed in to change notification settings - Fork 0
/
encrypt_lic.html
50 lines (44 loc) · 2.36 KB
/
encrypt_lic.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
41
42
43
44
45
46
47
48
49
50
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta charset="UTF-8">
<title>Encrypt .lic-file Aspose.PDF for JavaScript via C++</title>
<style>
a:link,a:visited{background-color:#5eef3d;color:#fff;padding:15px 25px;text-align:center;text-decoration:none;display:inline-block;margin-left:16px;border-radius:4px;border:thin solid grey}a:active,a:hover{background-color:#65ff43}
input::file-selector-button{font-weight:700;background-color:#5eef3d;color:#fff;padding:15px;text-align:center;text-decoration:none;display:inline-block;width:150px;border-radius:4px;border:thin solid grey}
</style>
</head>
<body style="background-color:#2871e6;font-family:Arial;margin:auto">
<div id="ASPOSE" style="overflow:auto">
<div style="float:left;margin-left:8px;margin-top:8px">
<img src="favicon.ico" alt="ASPOSE" width="32px" height="32px"/>
</div>
<div style="float:left;margin-left:8px;margin-top:8px">
<label style="color:white;font:bold 32px Arial">Aspose.PDF for JavaScript via C++</label>
</div>
<div style="border-top: 48px solid #000"></div>
</div>
<div style="margin-left:16px;margin-right:16px;margin-top:16px;margin-bottom:16px">
<br>
<label style="color:white;font:bold 16px Arial" for="fileEncrypt">Choose .lic-file to encrypt</label>
<input type="file" id="fileEncrypt" accept=".lic" onchange="ffileEncrypt(event)">
<br>
<pre id="output"></pre>
<br>
</div>
</body>
<script type="text/javascript" async src="AsposePDFforJS.js"></script>
<script type="text/javascript">
var ffileEncrypt = function(e) {
const file_reader = new FileReader();
file_reader.onload = (event) => {
const json = AsposePdfEncryptLic(event.target.result, e.target.files[0].name, "aspose.enc");
if (json.errorCode == 0) document.getElementById('output').textContent = "Encrypt OK: " + json.fileNameResult;
else document.getElementById('output').textContent = "Encrypt ERROR: " + json.errorText;
DownloadFile(json.fileNameResult, "application/octet-stream");
};
file_reader.readAsArrayBuffer(e.target.files[0]);
};
</script>
</html>