|
@@ -149,9 +149,17 @@ export default class HcPdfSign {
|
|
|
//设置签章图片
|
|
|
static async signImage(url) {
|
|
|
const res = await this.getImageSize(url)
|
|
|
- const scaleFactor = 100 / res.height
|
|
|
- const newWidth = res.width * scaleFactor
|
|
|
- this.signImgCss = { url: url, width: newWidth, height: 100 }
|
|
|
+ if (res.width === res.height) {
|
|
|
+ this.signImgCss = { url: url, width: 100, height: 100 }
|
|
|
+ } else if (res.width > res.height) {
|
|
|
+ const scaleFactor = 30 / res.height
|
|
|
+ const newWidth = res.width * scaleFactor
|
|
|
+ this.signImgCss = { url: url, width: newWidth, height: 30 }
|
|
|
+ } else {
|
|
|
+ const scaleFactor = 100 / res.height
|
|
|
+ const newWidth = res.width * scaleFactor
|
|
|
+ this.signImgCss = { url: url, width: newWidth, height: 100 }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
//获取网络图片的高宽
|