0
我的问题如下。从word文件设置数据到CK编辑器
我们使用CKEditor来显示编辑器内docx文件的内容。这个CKEditor将被加载到我们的Documnentum应用程序中。
我读了word文件并将其转换为HTML。 但是,当我试图使用
CKEDITOR.instances.editor1.setData('abc');
它给我“ABC”的值在屏幕设置HTML文件的数据:
<%
File file = new File("C:\\TestWordToHtml\\html\\Test.html");
BufferedReader br = null;
StringBuilder sb=new StringBuilder();
try {
String sCurrentLine;
br = new BufferedReader(new FileReader(file));
while ((sCurrentLine = br.readLine()) != null) {
sb.append(sCurrentLine);
//System.out.println(sCurrentLine);
}
System.out.println("final content is"+" "+sb.toString());
}
catch (IOException e) {
e.printStackTrace();
} finally {
try {
if (br != null)br.close();
} catch (IOException ex) {
ex.printStackTrace();
}
}
String htmdata = sb.toString();`enter code here`
%>
var abc=htmdata;
CKEDITOR.instances.editor1.setData('abc');