[英]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.