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');