2012-05-28 2 views
3

그것은 문자를 표시하지만 아랍어의 역순으로 다음 코드를 사용pdfbox를 사용하여 pdf에서 아랍어 텍스트를 표시하고 싶습니까?

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); 
+0

마지막 단락을 따를 http://pdfbox.apache.org/userguide/text_extraction.html은 RTL 텍스트 처리에 대한 지침이있다. – Ansari

+0

읽을 수는 있지만 ICU4J를 pdfbox와 함께 사용하면 문자를 올바르게 표시 할 수 없습니다. – Mohab

답변

4

다음

코드를 쓰기를 다시 클래스 경로에 넣어 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); 
관련 문제