Right-to-Left Text

With GemBox.Presentation, you can work with presentation that contain bidirectional texts. This includes languages that use right-to-left script such as Arabic, Persian, Urdu, Hebrew, or Yiddish. Besides read and write support for PPTX and read support for PPT format, GemBox.Presentation supports rendering of bidirectional texts to PDF, XPS, and image file formats.

You can use the ParagraphFormat.RightToLeft property to specify the reading direction of a paragraph.

The following example shows how you can convert a presentation with bidirectional text to PDF or other file formats.

Converted PDF with bidiretional text
Screenshot of converted PDF
Upload your file (Drag file here)
using GemBox.Presentation;

class Program
{
    static void Main()
    {
        // If using Professional version, put your serial key below.
        ComponentInfo.SetLicense("FREE-LIMITED-KEY");

        var presentation = PresentationDocument.Load("%InputFileName%");

        var slide = presentation.Slides[0];

        var shape = slide.Content.AddShape(ShapeGeometryType.Rectangle, 2, 2, 8, 4, LengthUnit.Centimeter);

        // Create a new right-to-left paragraph.
        var paragraph = shape.Text.AddParagraph();
        paragraph.Format.RightToLeft = true;
        paragraph.Format.Alignment = HorizontalAlignment.Right;
        var run = paragraph.AddRun("هذا ثمّة أمّا العالم، أم, السادس مواقعها");
        run.Format.Size = Length.From(28, LengthUnit.Point);

        presentation.Save("RightToLeft.%OutputFileType%");
    }
}
Imports GemBox.Presentation

Module Program

    Sub Main()

        ' If using Professional version, put your serial key below.
        ComponentInfo.SetLicense("FREE-LIMITED-KEY")

        Dim presentation = PresentationDocument.Load("%InputFileName%")

        Dim slide = presentation.Slides(0)

        Dim shape = slide.Content.AddShape(ShapeGeometryType.Rectangle, 2, 2, 8, 4, LengthUnit.Centimeter)

        ' Create a new right-to-left paragraph.
        Dim paragraph = shape.Text.AddParagraph()
        paragraph.Format.RightToLeft = true
        paragraph.Format.Alignment = HorizontalAlignment.Right
        Dim run = paragraph.AddRun("هذا ثمّة أمّا العالم، أم, السادس مواقعها")
        run.Format.Size = Length.From(28, LengthUnit.Point)

        presentation.Save("RightToLeft.%OutputFileType%")
    End Sub

End Module

Want more?

Next example GitHub

Check the next example or select an example from the menu. You can also download our examples from the GitHub.


Like it?

Download Buy

If you want to try the GemBox.Presentation yourself, you can download the free version. It delivers the same performance and set of features as the professional version, but with some operations limited. To remove the limitation, you need to purchase a license.