java将pdf文件转String
来源:互联网 发布:视频播放cms 编辑:程序博客网 时间:2024/06/16 21:17
/**
* 读取pdf文件内容
*
* @param file
* @return
* @throws IOException
* @see [类、类#方法、类#成员]
*/
public static String pdf2String(File file)
throws IOException
{
InputStream inputStream = new BufferedInputStream(new FileInputStream(file));
PDDocument pdfDocument = PDDocument.load(inputStream);
StringWriter writer = new StringWriter();
PDFTextStripper stripper = new PDFTextStripper();
stripper.writeText(pdfDocument, writer);
String contents = writer.getBuffer().toString();
// System.out.println(“文档内容:” + contents);
PDDocumentInformation documentInformation = pdfDocument.getDocumentInformation();
// System.out.println(“标题:” + documentInformation.getTitle());
pdfDocument.close(); return contents;}
- java将pdf文件转String
- java将string写入文件
- Java jacob 将Word 生成PDF文件
- JAVA 将图片转换成pdf文件
- java编程将HTML文件转换成PDF文件
- java编程将HTML文件转换成PDF文件
- java编程将HTML文件转换成PDF文件
- java 将excel文件转换成pdf文件
- java将String字符串写入文件
- java应用jcom将word转pdf
- java使用xmlWorkerHelper将html转pdf
- java URL转PDF文件
- java pdf文件转 图片
- java实现将文件(包含word,excel,图片等)转PDF
- java将WORD文档转换成pdf文件
- JAVA 将所有文件转为.pdf和.html
- java将Word/Excel/PDF文件转换成HTML整理
- java 将excel文件转换成pdf资料
- 服务器性能查看常用命令
- 51nod 1392:装盒子 匈牙利+贪心
- 未能加载类型"命名空间.类"
- BuildBox<0> 连接(Connection)
- 剑指offer 算法 (发散思维能力)
- java将pdf文件转String
- 二叉树中和为某一值的路径
- 在线支付so easy
- 分享:office2010的一些有用的小技巧
- Tutorial 02: Outputting to the Screen
- Android学习之路
- 图片放大插件Zoom
- 如何让cmd窗口执行上一条命令后暂停会继续执行下一条命令
- Java 数组合并问题