[英]How to fix width and height of the image in the react-CKEditor component?
如何在CKEditor中从原始图像尺寸减小图像尺寸。
<button type='button' className="ml-2 mr-0 btn btn-primary" onClick={this.logSig.bind(this)}>submit</button>
logSig = () => {
const signaturedata = this.signaturePad.toDataURL();
const signatureImg = '<img alt src=' + signaturedata + '/> ';
const { editorContent, signDialogOpenedFor } = this.state;
let elem = editorContent ? this.getElemForPDF(editorContent, signDialogOpenedFor, signatureImg) : signatureImg;
this.setState({
openSignatureDialog: false,
signDialogOpenedFor: '',
editorContent:elem
});
}
从大小300 * 150的image-2中,我需要在编辑器中使用200 * 100对其进行修复。 提前感谢
您不能只在您的签名图像常量中添加宽度和高度吗?
const signatureImg = '<img alt src=' + signaturedata + ' width=200 height=100/> ';
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.