tweaking signature frame
This commit is contained in:
parent
8581cb555a
commit
0dfc9b4f09
@ -115,15 +115,9 @@
|
|||||||
|
|
||||||
console.log(receiverSignature)
|
console.log(receiverSignature)
|
||||||
|
|
||||||
//canvas.width = width
|
|
||||||
//canvas.height = height
|
|
||||||
|
|
||||||
canvas.width = width * scale
|
canvas.width = width * scale
|
||||||
canvas.height = height * scale
|
canvas.height = height * scale
|
||||||
|
|
||||||
//canvas.style.width = width * 4
|
|
||||||
//canvas.style.height = height * 4
|
|
||||||
|
|
||||||
const ctx = canvas.getContext('2d')
|
const ctx = canvas.getContext('2d')
|
||||||
// This supposedly makes the lines and text less blurry
|
// This supposedly makes the lines and text less blurry
|
||||||
// See: https://stackoverflow.com/questions/8696631/canvas-drawings-like-lines-are-blurry
|
// See: https://stackoverflow.com/questions/8696631/canvas-drawings-like-lines-are-blurry
|
||||||
@ -133,7 +127,7 @@
|
|||||||
ctx.textRendering = "geometricPrecision"
|
ctx.textRendering = "geometricPrecision"
|
||||||
|
|
||||||
const date = new Date()
|
const date = new Date()
|
||||||
const dateString = date.toLocaleDateString('de-DE')
|
const dateString = date.toLocaleString('de-DE')
|
||||||
|
|
||||||
const signatureLength = 100 * scale
|
const signatureLength = 100 * scale
|
||||||
|
|
||||||
@ -157,7 +151,8 @@
|
|||||||
ctx.fillStyle = 'black'
|
ctx.fillStyle = 'black'
|
||||||
ctx.font = `${fontSize * scale}px sans-serif`
|
ctx.font = `${fontSize * scale}px sans-serif`
|
||||||
ctx.fillText('Signed by', 30 * scale, 10 * scale)
|
ctx.fillText('Signed by', 30 * scale, 10 * scale)
|
||||||
ctx.fillText(receiverName + ', ' + dateString, 15 * scale, 60 * scale)
|
ctx.fillText(receiverName, 15 * scale, 60 * scale)
|
||||||
|
ctx.fillText(dateString, 15 * scale, 70 * scale)
|
||||||
|
|
||||||
return new Promise((resolve) => {
|
return new Promise((resolve) => {
|
||||||
canvas.toBlob((blob) => {
|
canvas.toBlob((blob) => {
|
||||||
|
|||||||
@ -109,8 +109,8 @@ class App {
|
|||||||
|
|
||||||
if (isFormField === false && isSignature === true) {
|
if (isFormField === false && isSignature === true) {
|
||||||
|
|
||||||
const left = annotation.boundingBox.left - 25
|
const left = annotation.boundingBox.left - 20
|
||||||
const top = annotation.boundingBox.top - 25
|
const top = annotation.boundingBox.top - 20
|
||||||
const width = 150
|
const width = 150
|
||||||
const height = 75
|
const height = 75
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user