java通过POI技术将html转成word
生活随笔
收集整理的這篇文章主要介紹了
java通过POI技术将html转成word
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
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的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 数字图像处理基础与应用 第四章
- 下一篇: oracle19c的版本号_升级到 or