title: right to left with apache poi
body: <p>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.</p>
  <pre><code>    FileInputStream in = new FileInputStream(mypath);
              POIFSFileSystem fs = new POIFSFileSystem(in);
          
              HWPFDocument doc = new HWPFDocument(fs);
             
              
              
              Range r = doc.getRange();
               r.replaceText(&quot;&lt;matricule&gt;&quot;,&quot;  &quot;+agent.getMatriculeAgent());
              r.replaceText(&quot;&lt;cin&gt;&quot;,&quot;  &quot;+agent.getCin());
               OutputStream out = response.getOutputStream();
          response.setContentType(&quot;application/rtf&quot;);
          
          response.setHeader(&quot;Content-Disposition&quot;,&quot;attachment; filename=&quot;+fileName);
          doc.write(out);
          out.flush();
             
  </code></pre>
  <p>How can I set rtf alignment?</p>