[英]How to fix width and height of the image in the react-CKEditor component?
How to reduce the size of the image from original image size in CKEditor. 如何在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
});
}
we are inserting the signature image from the dialog box to the editor. 我们正在将签名图像从对话框插入编辑器。
in the editor after inserting the image it is of size 300 * 150 在插入图像后在编辑器中,图像的大小为300 * 150
From image-2 from size 300 * 150 i need to fix it with 200 * 100 in the editor. 从大小300 * 150的image-2中,我需要在编辑器中使用200 * 100对其进行修复。 Thanks in advnace 提前感谢
您不能只在您的签名图像常量中添加宽度和高度吗?
const signatureImg = '<img alt src=' + signaturedata + ' width=200 height=100/> ';
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.