syncfusion 文档编辑器组件默认提取编辑文本并隐藏右侧工具栏
extract the edited text and hide the right side toolbar by default in syncfusion document editor component
我在 angular 7 应用程序中使用 ej2 同步融合。
如何提取文档编辑器组件中的编辑文本。以及如何在创建文档编辑器组件时隐藏右侧工具栏。
注册。如何提取编辑后的文本。
要在编辑器中提取整个文档文本,您可以通过 selection 模块中的 selectAll API 和文本 [=] select 整个文档59=] 来自 selection,你可以得到 selected 文本。
请参考以下示例代码片段
//选择整个文档。
containerInstance.documentEditor.selection.selectAll()
//检索select编辑的文本
containerInstance.documentEditor.selection.text
您也可以在server-side中将文档另存为txt文件,读取文本文件内容得到文档正文。
服务器端保存文档内容请参考以下文档
https://ej2.syncfusion.com/angular/documentation/document-editor/export/#export-as-blob
在上面的文档示例中,示例将保存为RTF 文档。您可以将格式更改为TXT,并从文本文件中读取文本内容。
注册。 “如何在创建文档编辑器组件时隐藏 right-side 工具栏。”
是的,文档编辑器提供了隐藏属性窗格的选项。请在组件包装器
中将 showPropertiesPane 属性 设置为 false
示例代码片段
我在 angular 7 应用程序中使用 ej2 同步融合。 如何提取文档编辑器组件中的编辑文本。以及如何在创建文档编辑器组件时隐藏右侧工具栏。
注册。如何提取编辑后的文本。
要在编辑器中提取整个文档文本,您可以通过 selection 模块中的 selectAll API 和文本 [=] select 整个文档59=] 来自 selection,你可以得到 selected 文本。
请参考以下示例代码片段
//选择整个文档。
containerInstance.documentEditor.selection.selectAll()
//检索select编辑的文本
containerInstance.documentEditor.selection.text
您也可以在server-side中将文档另存为txt文件,读取文本文件内容得到文档正文。
服务器端保存文档内容请参考以下文档
https://ej2.syncfusion.com/angular/documentation/document-editor/export/#export-as-blob
在上面的文档示例中,示例将保存为RTF 文档。您可以将格式更改为TXT,并从文本文件中读取文本内容。
注册。 “如何在创建文档编辑器组件时隐藏 right-side 工具栏。”
是的,文档编辑器提供了隐藏属性窗格的选项。请在组件包装器
中将 showPropertiesPane 属性 设置为 false示例代码片段