问题
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