Tag: pdfbox

从大文件中提取文本

我需要从大文件中提取文本(最大限制50MB)文件可能是doc,ppt,xls,txt或pdf格式。 到目前为止,我已经使用Apache POI'http: //poi.apache.org/ ' 用于Microsoft Office文档和PDFBox从PDF中提取文本。 但是,随着文件变得特别大,以下文件,提取过程变慢。 结果到目前为止, 1.PPTX – 45MB – 3分钟apx 2.PDF – 62MB – 2分钟apx 3.Docx – 32MB – 15秒apx 4.XLS – 17MB – 10秒apx 5.XLSX – 7MB – 20秒apx 我需要这个过程是快速的。 我可以使用哪些API来实现这一点,以及哪些最佳实践可以帮助我提高应用程序的性能?

用PDF x&y坐标值写入Excel

我是这个Java世界的新手。 使用PDFBox PrintTextlocations,我可以使用下面的代码从PDF文件中读取x和y坐标值。 public class PrintTextLocations extends PDFTextStripper { public PrintTextLocations() throws IOException { super.setSortByPosition(true); } public static void main(String[] args) throws Exception { PDDocument document = null; try { File input = new File("abcdef.pdf"); document = PDDocument.load(input); if (document.isEncrypted()) { document.decrypt(""); } PrintTextLocations printer = new PrintTextLocations(); List allPages = document.getDocumentCatalog().getAllPages(); for (int i […]