Right to left with apache poi

I use apache poi to modify some existing rtf files and return a copy to the client in the web application. The issue with me is when I try to replace the text and insert another one that is in Arabic. here is 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 rtf alignment?

0
source share
1 answer

I solved the problem so simply, the problem is that I will replace the French word with Arabic, and since they are just the words used to determine the place where I should change the text, they can be any charchter and the more so. This is Arabic!

0
source

All Articles