@kne/react-pdf-sign 1.0.2 → 1.0.4
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 +31 -26
- package/dist/index.js +192 -1833
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +191 -1833
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -73,24 +73,26 @@ const BaseExample = () => {
|
|
|
73
73
|
}}
|
|
74
74
|
/>
|
|
75
75
|
</Button>
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
76
|
+
{pdfFile && (
|
|
77
|
+
<Button
|
|
78
|
+
onClick={() => {
|
|
79
|
+
const { size } = ref.current.getLocation();
|
|
80
|
+
signatureModal({
|
|
81
|
+
mask: (
|
|
82
|
+
<Flex justify="flex-end" align="flex-end" style={{ height: '100%', width: '100%', padding: '10px', boxSizing: 'border-box' }}>
|
|
83
|
+
签字日期: {new Date().toLocaleDateString()}
|
|
84
|
+
</Flex>
|
|
85
|
+
),
|
|
86
|
+
width: size.width,
|
|
87
|
+
height: size.height,
|
|
88
|
+
onSuccess: file => {
|
|
89
|
+
setSign(URL.createObjectURL(file));
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
}}>
|
|
93
|
+
添加签名
|
|
94
|
+
</Button>
|
|
95
|
+
)}
|
|
94
96
|
{pdfFile && sign && (
|
|
95
97
|
<Button
|
|
96
98
|
onClick={async () => {
|
|
@@ -187,19 +189,22 @@ const BaseExample = () => {
|
|
|
187
189
|
onClick={() => {
|
|
188
190
|
ref.current.setLocation({
|
|
189
191
|
size: {
|
|
190
|
-
width:
|
|
191
|
-
height:
|
|
192
|
-
x:
|
|
193
|
-
y:
|
|
192
|
+
width: 390,
|
|
193
|
+
height: 156,
|
|
194
|
+
x: 163,
|
|
195
|
+
y: 8
|
|
194
196
|
},
|
|
195
|
-
scaleX: 1,
|
|
196
|
-
scaleY: 1,
|
|
197
|
-
x:
|
|
198
|
-
y:
|
|
197
|
+
scaleX: 1.95,
|
|
198
|
+
scaleY: 1.95,
|
|
199
|
+
x: 163,
|
|
200
|
+
y: 8
|
|
199
201
|
});
|
|
200
202
|
}}>
|
|
201
203
|
设置签名位置
|
|
202
204
|
</Button>
|
|
205
|
+
<Button onClick={()=>{
|
|
206
|
+
ref.current.setLocation({});
|
|
207
|
+
}}>恢复到默认位置</Button>
|
|
203
208
|
<Button
|
|
204
209
|
onClick={() => {
|
|
205
210
|
const pdfSignature = ref.current.getPdfSignature();
|