![](/img/trans.png)
[英]Defining paragraph with RTL direction in word file by OpenXML in C#
[英]how to change direction and alignment of paragraph to rtl by aspsoe.word for c#.Net
我将段落的对齐方式更改为右对齐,但是当我将段落的方向更改为从右至左时(通过builder.ParagraphFormat.Bidi= true
),我的对齐方式将更改为左对齐。
builder.ParagraphFormat.Alignment = ParagraphAlignment.Right;
builder.Font.Bidi=true;
builder.Font.LocaleIdBi = 1025;
builder.ParagraphFormat.Bidi= true;
尝试将对齐方式移到Bidi语句之后?
我改变了
builder.ParagraphFormat.Alignment = ParagraphAlignment.Right;
至
builder.ParagraphFormat.Alignment = ParagraphAlignment.Left
和工作。
请尝试使用以下代码:
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一起担任开发人员推广人员。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.