Right to Left (RTL) text in XWPFDocument (Apache POI)

前端 未结 1 761
清酒与你
清酒与你 2020-12-12 06:33

I could not find a way to make a RTL paragraph in Docx using XWPFDocument (Apache POI) in my Java program. Here\'s my code that generates the XWPFDocument.

          


        
相关标签:
1条回答
  • 2020-12-12 07:09

    A workaround that I found till now is using a template document.

    Using this method, you make an empty document that "Normal" style in it, is configured to be RTL. This way, everything in your document will be RTL.

    XWPFDocument document = new XWPFDocument(AbstractWordView.class.getClassLoader().getResourceAsStream("empty.docx"));
    
    0 讨论(0)
提交回复
热议问题