从右到左与 apache poi [英] right to left with apache poi
本文介绍了从右到左与 apache poi的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用 apache poi 修改一些现有的 rtf 文件并将副本返回给 Web 应用程序中的客户端.我的问题是当我尝试替换一些文本并插入另一个用阿拉伯语代替的文本时.
I'm using apache poi to modify some existing rtf files and return a copy to the client in a web application. The issue with me is when I try to replace some text and insert another which is in Arabic instead.
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 对齐?
How can I set rtf alignment?
推荐答案
我很喜欢这个问题很简单,问题是因为我用阿拉伯语替换了法语单词,因此它们只是用于定位我所在位置的单词必须修改文本,它们可以是任何字符,更合适的是阿拉伯语!
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屋!
查看全文