3

它显示字母但以阿拉伯语的相反顺序我使用以下代码

  PDDocument pddDocument = PDDocument.load(new File("test1.pdf"));
        PDFTextStripper textStripper = new PDFTextStripper();

        TextNormalize normalize = new TextNormalize("UTF-8");
        String Text = textStripper.getText(pddDocument);

      Text=normalize.makeLineLogicalOrder(Text, true);
      Text = normalize.normalizePres(Text);
      Text = normalize.normalizeDiac(Text);
        System.out.println(Text);
4

1 回答 1

5

通过从http://site.icu-project.org/download/49#TOC-ICU4J-Download下载 icu4j-49_1.jar将其放入类路径中解决了问题

然后重写代码如下

PDDocument pddDocument = PDDocument.load(new File("test1.pdf"));
            PDFTextStripper textStripper = new PDFTextStripper();
            String Text = textStripper.getText(pddDocument);
            System.out.println(Text);
于 2012-05-28T02:44:54.137 回答