This project is read-only.
1
Vote

Right to left example

description

sorry for delay.
attached file is right to left example.

file attachments

comments

Tatibah wrote May 24, 2014 at 11:57 PM

Latest versionhas fix for this. For some reason I have not been able to add a comment. If all goes well I will add sMe examples here.

Tatibah wrote May 25, 2014 at 12:19 AM

Unfortunately I can't attach the examples, so I've included them below. Also the results as shown are NOR right to left, but if you run them they will be.

// Set the entire document RIGHT to LEFT
using Tatibah;

namespace TablesWithInTables
{
class Program
{
    static void Main(string[] args)
    {
        // Create the document
        Document document = new Document(@"C:\Word\RtoLexample.docx");
        document.__RightToLeft__ = true; // Set all to RLT

        document.Append(new Paragraph("This text to right to left."));

        // This paragraph wont be right to left
        document.Append(new Paragraph("This is left to right.") {__RightToLeft__ = false});

        // Save the Document
        document.Close();

    }
}
}
Result:
This text to right to left.
This is left to right.


// Just a paragraph RIGHT to LEFT
using Tatibah;

namespace TablesWithInTables
{
class Program
{
    static void Main(string[] args)
    {
        // Create the document
        Document document = new Document(@"C:\Word\RtoLexample.docx");

        document.Append(new Paragraph("left to right"));

        document.Append(new Paragraph("This text to right to left.") { __RightToLeft__ = true });

        // Save the Document
        document.Close();

    }
}
}
Result:
left to right
This text to right to left.

// Using Styles
using Tatibah;

namespace TablesWithInTables
{
class Program
{
    static void Main(string[] args)
    {
        // Create the document
        Document document = new Document(@"C:\Word\RtoLexample.docx");

        Style rtl = new Style("RtoL") { __RightToLeft__ = true };

        document.Append(new Paragraph("This is a normal paragraph."));

        // This paragraph is Styled
        document.Append(new Paragraph("This is a styled paragraphleft to right.") {__Style__ = rtl});

        // Save the Document
        document.Close();

    }
}
}
Result:
This is a normal paragraph.
This is a styled paragraphleft to right.

Tatibah wrote May 26, 2014 at 10:44 AM

Ignorethe underscores not meantto be there