ParagraphFormatBidi Property |
Namespace: Aspose.Words
When true, the runs and other inline objects in this paragraph are laid out right to left.
// Create a blank document and a document builder Document doc = new Document(); DocumentBuilder builder = new DocumentBuilder(doc); // Use our builder to insert a BIDIOUTLINE field // This field numbers paragraphs like the AUTONUM/LISTNUM fields, // but is only visible when a RTL editing language is enabled, such as Hebrew or Arabic // The following field will display ".1", the RTL equivalent of list number "1." FieldBidiOutline field = (FieldBidiOutline)builder.InsertField(FieldType.FieldBidiOutline, true); Assert.AreEqual(" BIDIOUTLINE ", field.GetFieldCode()); builder.Writeln("שלום"); // Add two more BIDIOUTLINE fields, which will be automatically numbered ".2" and ".3" builder.InsertField(FieldType.FieldBidiOutline, true); builder.Writeln("שלום"); builder.InsertField(FieldType.FieldBidiOutline, true); builder.Writeln("שלום"); // Set the horizontal text alignment for every paragraph in the document to RTL foreach (Paragraph para in doc.GetChildNodes(NodeType.Paragraph, true)) { para.ParagraphFormat.Bidi = true; } // If a RTL editing language is enabled in Microsoft Word, out fields will display numbers // Otherwise, they will appear as "###" doc.Save(ArtifactsDir + "Field.BIDIOUTLINE.docx");