【问题标题】: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
【解决方案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
并且工作了。