933d64c8 by renchao@pashanhoo.com

style:不动产权证书

1 parent 161e1e31
<!--
* @Description:
* @Autor: renchao
* @LastEditTime: 2023-07-28 15:47:25
* @LastEditTime: 2023-08-10 15:20:52
-->
<template>
<div>
......@@ -154,7 +154,27 @@
context.fillText(line, 138, y + (index * 20)); // 调整行高
})
})
context.fillText(this.bdcqz.fj ? this.bdcqz.fj : '', 580, 100);
let lines1 = this.bdcqz.fj ? this.bdcqz.fj.split(' ') : [];
lines1.forEach((line, index) => {
const y = 100 + (index * 37); // 每行文本的垂直位置
let currentLine = '';
let arr = [];
for (let word of line) {
const testLine = currentLine + word;
const lineWidth = context.measureText(testLine).width;
if (lineWidth <= 395) {
currentLine = testLine;
} else {
arr.push(currentLine);
currentLine = word;
}
}
arr.push(currentLine);
arr.forEach((line, index) => {
context.fillText(line, 580, y + (index * 20)); // 调整行高
})
})
}
image.src = this.imgSrc
},
......