繁体   English   中英

如何在react-CKEditor组件中固定图像的宽度和高度?

[英]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

从大小300 * 150的image-2中,我需要在编辑器中使用200 * 100对其进行修复。 提前感谢

您不能只在您的签名图像常量中添加宽度和高度吗?

    const signatureImg = '<img alt src=' + signaturedata + ' width=200 height=100/> ';

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM