Hi,
Hi Bojan,
Hi,
Hi Bojan,
builder.getFont().setLocaleIdBi(2057);<o:p></o:p>
//Run run = new Run(document, "English text");
//paragraph.insertBefore(run, paragraph.getFirstChild());
builder.write("English text");
document.save(MyDir + "out.docx");
Hi,
Hi Bojan,
Document document = new Document(MyDir
- “onesentence.docx”);<o:p></o:p>
DocumentBuilder builder = new DocumentBuilder(document);
Paragraph paragraph = (Paragraph)document.getSections().get(0).getBody().getParagraphs().get(0);
builder.moveTo(paragraph.getFirstChild());
builder.getFont().clearFormatting();
builder.getFont().setBidi(false);
builder.getFont().setLocaleId(2057);
builder.write("English text");
document.save(MyDir + "out.docx");
The Font.setLocaleIdFarEast method is used to gets or sets the locale identifier (language) of the formatted Asian characters.
I have not found the France.docx in attachment. Please share this document if you still face issue.
Hi,
Hi Bojan,
Document document = new Document(MyDir
- “France.docx”);<o:p></o:p>
Paragraph paragraph = (Paragraph)document.getSections().get(0).getBody().getParagraphs().get(0);
Run run = new Run(document, "English text");
run.getFont().setLocaleId(2057);
paragraph.insertBefore(run, paragraph.getFirstChild());
document.save(MyDir + "out.docx");
Hi,
Hi Bojan,
bjerinic:
This is not so good for me because I use the DocumentBuilder for writining text and setting a font of it. It will be so good that you can fix this for the DocumentBuilder class?
Document document = new Document(MyDir
- “France.docx”);<o:p></o:p>
DocumentBuilder builder = new DocumentBuilder(document);
Paragraph paragraph = (Paragraph)document.getSections().get(0).getBody().getParagraphs().get(0);
builder.moveTo(paragraph.getFirstChild());
builder.getFont().clearFormatting();
builder.getFont().setLocaleId(2057);
// Specify the locale so Microsoft Word recognizes this text as Arabic - Saudi Arabia.
builder.getFont().setLocaleIdBi(1025);
builder.getFont().setBidi(false);
builder.write("English text");
builder.getFont().setBidi(true);
builder.write("مرحبًا");
document.save(MyDir + "out.docx");