如何在 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
});
}
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 的图像 2,我需要在编辑器中将其修改为 200 * 100。
提前致谢
您不能只在 signatureImg 常量中添加宽度和高度吗?
const signatureImg = '<img alt src=' + signaturedata + ' width=200 height=100/> ';
如何在 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 的图像 2,我需要在编辑器中将其修改为 200 * 100。 提前致谢
您不能只在 signatureImg 常量中添加宽度和高度吗?
const signatureImg = '<img alt src=' + signaturedata + ' width=200 height=100/> ';