933d64c8 by renchao@pashanhoo.com

style:不动产权证书

1 parent 161e1e31
1 <!-- 1 <!--
2 * @Description: 2 * @Description:
3 * @Autor: renchao 3 * @Autor: renchao
4 * @LastEditTime: 2023-07-28 15:47:25 4 * @LastEditTime: 2023-08-10 15:20:52
5 --> 5 -->
6 <template> 6 <template>
7 <div> 7 <div>
...@@ -154,7 +154,27 @@ ...@@ -154,7 +154,27 @@
154 context.fillText(line, 138, y + (index * 20)); // 调整行高 154 context.fillText(line, 138, y + (index * 20)); // 调整行高
155 }) 155 })
156 }) 156 })
157 context.fillText(this.bdcqz.fj ? this.bdcqz.fj : '', 580, 100); 157
158 let lines1 = this.bdcqz.fj ? this.bdcqz.fj.split(' ') : [];
159 lines1.forEach((line, index) => {
160 const y = 100 + (index * 37); // 每行文本的垂直位置
161 let currentLine = '';
162 let arr = [];
163 for (let word of line) {
164 const testLine = currentLine + word;
165 const lineWidth = context.measureText(testLine).width;
166 if (lineWidth <= 395) {
167 currentLine = testLine;
168 } else {
169 arr.push(currentLine);
170 currentLine = word;
171 }
172 }
173 arr.push(currentLine);
174 arr.forEach((line, index) => {
175 context.fillText(line, 580, y + (index * 20)); // 调整行高
176 })
177 })
158 } 178 }
159 image.src = this.imgSrc 179 image.src = this.imgSrc
160 }, 180 },
......