提取的pdf文本未在控制台中显示

时间:2019-06-18 04:20:59

标签: java tabula

我正在尝试使用Tabula提取pdf文本。但是代码没有错误,但是当我运行提取的pdf文本时,它不会显示在控制台中。可以帮个忙。

我一直在使用PDFBox,并且在进行了一些研究之后,我发现表格是新的并且想尝试一下。

File file = new File(pdfFilePath);
PDDocument document = PDDocument.load(file);
ObjectExtractor oe = new ObjectExtractor(document);
Page page = oe.extract(1) //1st page
TextStripper textStripper = new TextStripper(document,1);
System.out.println(textStripper.getText(document));

output of pdf text

1 个答案:

答案 0 :(得分:1)

您没有使用page变量。尝试以下代码。

[EnumWindows(EnumWindowsDelegate lpEnumFunc, IntPtr lParam)],

(https://docs.microsoft.com/en-us/windows/desktop/api/winuser/nf-winuser-enumwindows)  
相关问题