Sign In  Sign Up Live-Chat

Complex writing

Last post 05-13-2008, 6:30 AM by alexey.noskov. 3 replies.
Sort Posts: Previous Next
  •  05-12-2008, 1:05 AM 126440

    Complex writing

    Dear Sir

    I have  FormField object in a section in my Word document.I use "Aspose.Words" component  for filling this formfield through my program. It is work very nice with both right to left and left to right languages but when I want to use a complex script(mix of right to left and left to right languages) this component reverse it and Bidi property can't do anything for me.

    Please tell how do I solve this problem because it'ss very important for me.

     

    Thanks

    Mehdi Mokhtari

     
  •  05-12-2008, 3:30 AM 126454 in reply to 126440

    Re: Complex writing

    Hi

     

    Thanks for your request. Every form field in the document is marked by bookmark. So you can use DocumentBuilder to navigate in the document. You can also use Documentbuilder to insert RTL and LTR text into the form field. For example try using the following code:

     

    Document doc = new Document(@"Test168\in.doc");

    DocumentBuilder builder = new DocumentBuilder(doc);

    //Get formfield from document

    FormField myFormField = doc.Range.FormFields["myFormField"];

    myFormField.Result = string.Empty;

    //Move cursor of DocumentBuilder to bookmark that marks Formfield

    builder.MoveToBookmark(myFormField.Name, true, true);

    //Search for the FieldEnd Node

    Node currentNode = builder.CurrentNode;

    while (currentNode.NodeType != NodeType.FieldEnd)

    {

        currentNode = currentNode.NextSibling;

    }

    //Move cursor to the end of field

    builder.MoveTo(currentNode);

    //Insert left to Right text

    builder.Write("test");

    //insert right to left text

    builder.Font.Bidi = true;

    builder.Font.LocaleIdBi = 1025;

    builder.Write("مرحبًا");

    //Save document

    doc.Save(@"Test168\out.doc");

     

    I hope this could help you.

     

    Best regards.


    Alexey Noskov
    Developer/Technical Support
    Aspose Auckland Team
     
  •  05-13-2008, 12:01 AM 126601 in reply to 126454

    Re: Complex writing

    Dear Sir

    Thanks for your quick reply and your solution.But I must fill my FormField with a parameter and your solution needs more line of code and I must detect character by characer.

    I want to know could you fix this problem in your component  or not and if you could fix it in which version and how long you will do it?

    Thanks

    Mehdi Mokhtari

     
  •  05-13-2008, 6:30 AM 126652 in reply to 126601

    Re: Complex writing

    Hi

     

    Thanks for your request. I have created new issue #5099 in our defect database. I can’t promise you that we will fix this issue in the nearest future. So I think that you should use the workaround I suggested.

     

    Best regards.


    Alexey Noskov
    Developer/Technical Support
    Aspose Auckland Team
     
View as RSS news feed in XML