2012-11-20 69 views
0

我使用apache poi來修改一些現有的rtf文件並將一個副本返回到客戶端在web應用程序 issu與我是當我嘗試替換一些文本並插入另一個至少阿拉伯語代替。 這裏我的代碼:從右到左與apache poi

FileInputStream in = new FileInputStream(mypath); 
      POIFSFileSystem fs = new POIFSFileSystem(in); 

      HWPFDocument doc = new HWPFDocument(fs); 



      Range r = doc.getRange(); 
      r.replaceText("<matricule>"," "+agent.getMatriculeAgent()); 
      r.replaceText("<cin>"," "+agent.getCin()); 
      OutputStream out = response.getOutputStream(); 
     response.setContentType("application/rtf"); 

     response.setHeader("Content-Disposition","attachment; filename="+fileName); 
     doc.write(out); 
     out.flush(); 

如何設置一個RTF alignement?

回答

0

我重新解決了這個問題非常簡單,問題是因爲我用阿拉伯語替換了法語單詞,並且因爲這只是用來定位我需要修改文本的單詞,它們可以是任何charchter和更合適的是阿拉伯語!

+0

你有什麼想法如何對齊HWPFDocument paragraphes(左,右,中; JUSTIFIED)你呢? –