right to left with apache poi

亡梦爱人 提交于 2019-12-12 01:33:48

问题


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();

how to set an rtf alignement ?


回答1:


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 !



来源:https://stackoverflow.com/questions/13477271/right-to-left-with-apache-poi

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!