编写HTML内容到MS Word使用JAVA? [英] Writing HTML content into MS WORD using JAVA?
问题描述
我正在开发中,我已经使用标和标一考试软件。所以我要在HTML中的问题存储在数据库中,
现在我想用HTML标记这些问题写的字,
我尝试使用Apache POI库,
这里是示例文本:
I am developing an Exam Software in which I have used Subscript and superscript. so I have to store the Questions in HTML in the Database, Now i want to write those questions with HTML tags to the word, I tried Using Apache POI Library, here is the sample text :
<html>
<head> </head>
<body><font face="Shruti"> MY QUESTION </font>
</body>
</html>
但是当我尝试使用Apache POI写在Word文档中的文本,它显示HTML标签
but when I am trying to write text in word Document using apache poi , it is showing the HTML tags
推荐答案
您可以添加HTML作为AltChunk,并让Word将其转换为当文件第一次打开本机的docx的内容。
You can add your HTML as an AltChunk, and have Word convert it to native docx content when the file is first opened.
如果你需要转换为Java本机的docx内容,您可以使用 docx4j-ImportXHTML 一>
If you need to convert to native docx content in Java, you can use docx4j-ImportXHTML
披露:我管理该回购
这篇关于编写HTML内容到MS Word使用JAVA?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!