Inserting mixed text (RTL and LTR) in bookmark

When I insert text RLT and LTR sign of WORD with code

Document Doc = new Document(“a.doc”);
DocumentBuilder builder = new DocumentBuilder(Doc);
String Text1 = "החזרת מכולה 40’ ריקה מס’ EISU 1775219 לדפו";
builder.MoveToBookmark(“B31”,true,true);
builder.Write(Text1);
Doc.Save(“b.docx”);

B31 bookmark text is different from copied text with CTRL + C.

Copy text marked in red.

EISU 1775219 - Container number is wrong

Source file a.doc and processed file b.docx attached

Hi Alex,

Thanks for your inquiry. Please try executing the following code to achieve what you’re looking for:

Document doc = new Document(MyDir + @"a.doc");
DocumentBuilder builder = new DocumentBuilder(doc);
builder.MoveToBookmark("B31", true, true);
builder.Font.Bidi = true;
builder.Write("החזרת מכולה 40' ריקה מס");
builder.Font.Bidi = false;
builder.Write("' EISU 1775219");
builder.Font.Bidi = true;
builder.Write(" לדפו");
doc.Save(MyDir + @“out.docx”);

I hope, this helps.

Best regards,

I am sorry, but
I receive this string as customer input in my system.
I need your help please.

Hi Alex,

Thanks for your inquiry. This looks like a shortcoming of DocumentBuilder which probably has to automatically modify Bidi context when receiving RTL/LTR mixed text and break into several runs properly attributed when receiving mixed text. I have logged your requirement in our issue tracking system as WORDSNET-10667. Our development team will further look into the details of this problem and we will keep you updated on the status of correction. We apologize for your inconvenience.

Best regards,

Do you have expectations of a solution ?

Best regards

Alex

Hi Alex,

Thanks for your inquiry, Unfortunately, this issue is not resolved yet. We have asked the ETA of this issue from our development team and will update you as soon as it is available. We apologize for any inconvenience.

Best regards,

I am waiting for you answer

Hi Alex,

Thanks for being patient. The issue has now been resolved and it’s fix will be included in Aspose.Words 14.10.0 (next version). We will inform you via this thread as soon as this release is published.

Best regards,

The issues you have found earlier (filed as WORDSNET-10667) have been fixed in this .NET update and this Java update.

This message was posted using Notification2Forum from Downloads module by aspose.notifier.