2012-11-20 70 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)你呢? –