我想要使用Apache PDFBox的1.8.4提取PDF文本 - 我的代碼波紋管:使用Apache PDFBox提取出錯文字的文本?
public static void main(String[] args) throws Exception {
PDDocument pdfDocument = PDDocument.load(new File("rep.pdf"));
PDFTextStripper stripper = new PDFTextStripper();
String s = stripper.getText(pdfDocument);
System.out.println(s);
pdfDocument.close();
}
PDF它要轉換:https://www.dropbox.com/s/t35rr23v4383yvt/Form-V-report.pdf?dl=0
但有這樣charecters:
!"#$%&'()*$+,)!'-,./+/
0+12)3$#'(,,)451#+('1)65+7(,+'(/
!"#$%&'(
)*+,-.##(',/$.0
123.4.5,67,,89:;+
<3$'(=,>:++?,*99%@AB)
任何解決方案?
提前 - 謝謝。
讀https://pdfbox.apache.org/1.8/faq.html#gibberish。順便說一句,你的版本已經過時了。 (儘管當前版本無法提取文本) –