scandoc-ai-components 0.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +83 -0
- package/dist/2505ae470906b486e9af.module.wasm +0 -0
- package/dist/2ad8a36a589c565fbee0.mjs +2876 -0
- package/dist/97d8ed7170daf34c90d5.wasm +0 -0
- package/dist/index.js +368 -0
- package/package.json +33 -0
package/README.md
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# ScanDoc-AI
|
|
2
|
+
|
|
3
|
+
We offer a pure JavaScript package for integrating ScanDoc-AI services.
|
|
4
|
+
|
|
5
|
+
To get an access token please contact: info@scandoc.ai
|
|
6
|
+
|
|
7
|
+
## HTML integration
|
|
8
|
+
run: ```npm install scandoc-ai-components```
|
|
9
|
+
|
|
10
|
+
An example HTML page integration:
|
|
11
|
+
```
|
|
12
|
+
<!DOCTYPE html>
|
|
13
|
+
<html>
|
|
14
|
+
<head>
|
|
15
|
+
<title>ScanDoc-AI</title>
|
|
16
|
+
<meta charset="UTF-8" />
|
|
17
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
18
|
+
<script src="node_modules/scandoc-ai/dist/index.js"></script>
|
|
19
|
+
<body>
|
|
20
|
+
<style>
|
|
21
|
+
:root {
|
|
22
|
+
display: flex;
|
|
23
|
+
flex: 1;
|
|
24
|
+
flex-direction: column;
|
|
25
|
+
height: 100vh;
|
|
26
|
+
width: 100vw;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
html, body {
|
|
30
|
+
display: flex;
|
|
31
|
+
flex: 1;
|
|
32
|
+
flex-direction: column;
|
|
33
|
+
font-family: "Roboto", impact, condensed, sans-serif;
|
|
34
|
+
background-color: #fefefe;
|
|
35
|
+
box-sizing: border-box;
|
|
36
|
+
font-size: 14px;
|
|
37
|
+
align-items: center;
|
|
38
|
+
|
|
39
|
+
}
|
|
40
|
+
</style>
|
|
41
|
+
|
|
42
|
+
<div id="test" style="width: 50%;height: auto;padding: 20px;"></div>
|
|
43
|
+
<script>
|
|
44
|
+
const key = ""; // Use the key provided by our team
|
|
45
|
+
createScanDocAIConfig(key, "test");
|
|
46
|
+
const extractionVideo = getExtractionVideo(function (data) { console.log(data)});
|
|
47
|
+
//
|
|
48
|
+
const html = extractionVideo.getHTML();
|
|
49
|
+
document.getElementById('test').innerHTML = html;
|
|
50
|
+
extractionVideo.startVideo();
|
|
51
|
+
</script>
|
|
52
|
+
</body>
|
|
53
|
+
</html>
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## React integration
|
|
57
|
+
run: ```npm install scandoc-ai-components```
|
|
58
|
+
|
|
59
|
+
An example React integration:
|
|
60
|
+
```
|
|
61
|
+
import { useEffect, useMemo } from "react";
|
|
62
|
+
import "scandoc-ai/dist/index"
|
|
63
|
+
|
|
64
|
+
const key = ""; // Use the key provided by our team
|
|
65
|
+
window.createScanDocAIConfig(key, "test");
|
|
66
|
+
const extractionVideo = window.getExtractionVideo(data=>console.log(data));
|
|
67
|
+
|
|
68
|
+
function App() {
|
|
69
|
+
const html = useMemo(()=>extractionVideo.getHTML(), []);
|
|
70
|
+
useEffect(()=>{
|
|
71
|
+
extractionVideo.startVideo();
|
|
72
|
+
}, []);
|
|
73
|
+
|
|
74
|
+
return (
|
|
75
|
+
<div dangerouslySetInnerHTML={{__html: html}} />
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export default App;
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### Note
|
|
83
|
+
If you have problems integrating the solution please contact: support@scandoc.ai
|
|
Binary file
|