poi将html导出到word
来源:互联网 发布:ucg软件下载 编辑:程序博客网 时间:2024/06/06 18:47
import java.io.ByteArrayInputStream;import java.io.File;import java.io.FileOutputStream;import java.io.IOException;import org.apache.poi.poifs.filesystem.DirectoryEntry;import org.apache.poi.poifs.filesystem.DocumentEntry;import org.apache.poi.poifs.filesystem.POIFSFileSystem;public class Main {public static void main(String[] args) { boolean w = false; String path = "d:/"; try { if (!"".equals(path)) { // 检查目录是否存在 File fileDir = new File(path); if (fileDir.exists()) { // 生成临时文件名称 String fileName = "a.doc"; String content = "<html><div style=\"text-align: center\"><span style=\"font-size: 28px\"><span style=\"font-family: 黑体\">" + "制度发布通知<br /> <br /> </span></span></div></html>"; byte b[] = content.getBytes(); ByteArrayInputStream bais = new ByteArrayInputStream(b); POIFSFileSystem poifs = new POIFSFileSystem(); DirectoryEntry directory = poifs.getRoot(); DocumentEntry documentEntry = directory.createDocument("WordDocument", bais); FileOutputStream ostream = new FileOutputStream(path+ fileName); poifs.writeFilesystem(ostream); bais.close(); ostream.close(); } } } catch (IOException e) { e.printStackTrace(); } }}
0 0
- poi将html导出到word
- java将html导出到word
- javascrip将html导出到word
- java将html导出到word
- POI 将数据导出到Word的实例
- 将html导出word
- java将html导出成word(利用的poi包导出)
- java将html导出成word(利用的poi包导出)
- 将GridView中的数据导出到Excel,Word,Html
- 使用poi将word转换为html
- poi 将word文档转HTML格式
- poi将word docx转化为html
- 使用poi将word转为html
- response导出html到word
- 使用poi将数据导出到excel
- java将html导出成word
- Java编程琐事(8)——java将html导出到word
- POI 导出word
- 小众编程语言同样值得你关注
- IOS公司开发者账号申请详细教程
- 创立10年,已成为自助建站翘楚的 Squarespace .这五大成功经验.
- 文件操作初体验
- JavaScript绝句的小研究
- poi将html导出到word
- Java常见内存溢出(OOM)解决方案
- 使用iostat分析IO性能
- 单点触控事件、
- Java常见面试题
- 焚心?
- 系统命令
- 图灵5月书讯:阅读是对自己沉默的爱
- 分治法、动态规划、贪心算法看法