从右到左与Apache POI [英] right to left with apache poi
问题描述
我使用的Apache POI修改一些现有的RTF文件,并在Web应用程序返回副本到客户端
与我ISSU是,当我尝试replacesome文本,并插入另一至极是阿拉伯语代替。
我在这里的code:
i'm using apache poi to modify some existing rtf files and return a copy to the client in a web application the issu with me is when i try to replacesome text and insert another wich is in arabic instead. here my code :
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?
how to set an rtf alignement ?
推荐答案
我resloved它是如此简单的问题,这个问题是由于我取代法语词与阿拉伯的人,并因为这一点,他们只是用来定位的话,其中i要修改的文字,也可以是任意charchter和更合适的是阿拉伯语!
i resloved the problem it's so simple , the problem is due that i replace french word with arab ones and since this they are just a words used to locate where i have to modify the text , they can be any charchter and the more appropriate is arabic !
这篇关于从右到左与Apache POI的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!