admin管理员组文章数量:1516870
private static void inputStreamToWord() throws IOException {
String content = "<html>" +
"<head>你好</head>" +
"<body>" +
"<table>" +
"<tr>" +
"<td>信息1</td>" +
"<td>信息2</td>" +
"<td>t3</td>" +
"<tr>" +
"</table>" +
"</body>" +
"</html>";
InputStream is = new ByteArrayInputStream(content.getBytes("GBK"));
OutputStream os = new FileOutputStream("f:\\1.doc");//这里写成自己要输出的路径
POIFSFileSystem fs = new POIFSFileSystem();
fs.createDocument(is, "WordDocument");
fs.writeFilesystem(os);
os.close();
is.close();
}版权声明:本文标题:java通过POI技术将html转成word 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://www.betaflare.com/biancheng/1726310715a1071095.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。


发表评论