gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-11-28 02:21:31 25 4
gpt4 key购买 nike

如何在 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 的 image-2 我需要在编辑器中用 200 * 100 修复它。提前致谢

最佳答案

您不能只在 signatureImg 常量中添加宽度和高度吗?

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

关于javascript - 如何在 react-CKEditor 组件中固定图像的宽度和高度?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48184160/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com