Tag: text extraction

使用iText从pdf文件中提取文本列

我需要使用iText从pdf文件中提取文本。 问题是:一些pdf文件包含2列,当我提取文本时,我得到一个文本文件,其中列被合并为结果(即同一行中两列的文本) 这是代码: public class pdf { private static String INPUTFILE = “http://www.revuemedecinetropicale.com/TAP_519-522_-_AO_07151GT_Rasoamananjara__ao.pdf” ; private static String OUTPUTFILE = “c:/new3.pdf”; public static void main(String[] args) throws DocumentException, IOException { Document document = new Document(); PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream(OUTPUTFILE)); document.open(); PdfReader reader = new PdfReader(INPUTFILE); int n = reader.getNumberOfPages(); PdfImportedPage page; // Go through […]