Hello,
As I am inserting number after arabic text then arabic text mix with number. So can you please suggest that how can fix this issue. As given below screen shot.
As I am using below code.
DocumentBuilder docBuilder = new DocumentBuilder(worddoc);
string htmlString = "<span>Dev test arabic test (اختبار القيمة العربية) 1234</span>";
docBuilder.InsertHtml(htmlLIFootNoteString);
@RiteshK10 When I copy paste your code, the order becomes the same as on your screenshot. If you need to insert mixed LTR and RTL text, I would suggest you to use Font.Bidi property.
Hello @alexey.noskov I am using same property as suggested by you but issue is not resolved yet.
@RiteshK10 Could you please create the expected output in MS Word and attach it here for our reference? We will check it and provide you more information.
Hello @alexey.noskov Thanks for update.
I have used below code and output is also attached so please check and confirm that how can resolve this issue.
Document doc = new Document();
DocumentBuilder Headbuilder= new DocumentBuilder(doc);
Headbuilder.Font.Name = "Courier New";
Headbuilder.Font.Size = 16;
Headbuilder.Font.Italic = false;
Headbuilder.Font.Bold = false;
Headbuilder.Font.LocaleId = new CultureInfo("en-US", false).LCID;
Headbuilder.Font.NameBi = "Andalus";
Headbuilder.Font.SizeBi = 24;
Headbuilder.Font.ItalicBi = true;
Headbuilder.Font.BoldBi = true;
Headbuilder.Font.LocaleIdBi = new CultureInfo("ar-AR", false).LCID;
Headbuilder.Font.Bidi = true;
Headbuilder.Write("Testing Data Pvt Ltd.");
Headbuilder.Font.Bidi = false;
Headbuilder.Write("(اختبار القيمة العربية) 1234");
doc .Save(DirectoryName, SaveFormat.Docm);
ArabicFont.Bidi.docx (30.1 KB)
@RiteshK10 To get the expected output you should use code like the following:
Document doc = new Document();
DocumentBuilder Headbuilder = new DocumentBuilder(doc);
Headbuilder.Font.Name = "Courier New";
Headbuilder.Font.Bidi = false;
Headbuilder.Font.LocaleId = new CultureInfo("en-US", false).LCID;
Headbuilder.Write("Testing Data Pvt Ltd.");
Headbuilder.Font.NameBi = "Andalus";
Headbuilder.Font.Bidi = true;
Headbuilder.Font.LocaleIdBi = new CultureInfo("ar-AR", false).LCID;
Headbuilder.Write("(اختبار القيمة العربية)");
Headbuilder.Font.Name = "Courier New";
Headbuilder.Font.Bidi = false;
Headbuilder.Font.LocaleId = new CultureInfo("en-US", false).LCID;
Headbuilder.Write("1234");
doc.Save(@"C:\Temp\out.docx");
out.docx (7.1 KB)