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(); }
发布者:admin,转转请注明出处:http://www.yc00.com/web/1733522183a3690354.html
评论列表(0条)