【问题标题】:how to change direction and alignment of paragraph to rtl by aspsoe.word for c#.Net如何通过 aspose.word for c#.Net 将段落的方向和对齐方式更改为 rtl
【发布时间】:2017-11-29 10:53:24
【问题描述】:

我将段落的对齐方式更改为右对齐,但是当我将段落的方向更改为从右到左(builder.ParagraphFormat.Bidi= true)时,我的对齐方式更改为左对齐。

builder.ParagraphFormat.Alignment = ParagraphAlignment.Right;
builder.Font.Bidi=true;
builder.Font.LocaleIdBi = 1025;
builder.ParagraphFormat.Bidi= true;

【问题讨论】:

    标签: c# .net ms-word aspose aspose.words


    【解决方案1】:

    尝试将对齐移动到 Bidi 语句之后?

    【讨论】:

      【解决方案2】:

      请尝试使用以下代码:

      Document doc = new Document();
      DocumentBuilder builder = new DocumentBuilder(doc);
      
      // Signal to Microsoft Word that this run of text contains right-to-left text.
      builder.Font.Bidi = true;
      builder.CurrentParagraph.ParagraphFormat.Bidi = true;
      
      builder.Font.LocaleIdBi = 1025;
      
      // Insert some Arabic text.
      builder.Writeln("هذا كتاب.");
      
      doc.Save("D:\\Temp\\17.11.docx");
      

      我与 Aspose 合作,担任开发人员宣传员。

      【讨论】:

        【解决方案3】:

        我改变了

        builder.ParagraphFormat.Alignment = ParagraphAlignment.Right;

        builder.ParagraphFormat.Alignment = ParagraphAlignment.Left

        并且工作了。

        【讨论】:

          猜你喜欢
          • 2018-04-28
          • 2012-02-02
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2019-09-22
          • 1970-01-01
          • 2020-04-30
          • 1970-01-01
          相关资源
          最近更新 更多