DynaPDF.SetBidiMode
-------------------

Sets or changes the bidirectional mode.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [DynaPDF](component_DynaPDF.md) | [15.2](newinversion152.md) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |

MBS( "DynaPDF.SetBidiMode"; PDF; Mode ) 

**MBS**( **"DynaPDF.SetBidiMode";** /\* Sets or changes the bidirectional mode. \*/  
**$PDF**; /\* The PDF reference returned from [DynaPDF.New](DynaPDFNew.md). \*/   
**$Mode**) /\* Bidirectional mode.  
Can be LeftToRight, RightToLeft or None.e.g. "LeftToRight" \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| PDF | The PDF reference returned from [DynaPDF.New](DynaPDFNew.md). | $pdf |
| Mode | Bidirectional mode.   Can be LeftToRight, RightToLeft or None. | "LeftToRight" |

### Result

Returns OK or error.

### Description

Sets or changes the bidirectional mode.  
When using a bidirectional 8 bit code page the bidirectional algorithm is applied by default in Left to Right mode also if the bidi mode is set to None (default). This mode produces identical results in comparison to applications like Edit or WordPad from Microsoft Windows.  
If the current font was loaded with the code page Unicode the bidirectional algorithm is applied only if the bidi mode is not set to None.  
  
DynaPDF uses internally the Reference Bidi Algorithm of the Unicode Consortium to process bidirectional strings. The algorithm supports the entire UCS-2 range and it is used by many applications. However, the Right to Left mode produces different results in comparison to Microsoft's Uniscribe. If you need the same result in Right to Left mode as Uniscribe would produce then you must pre-process the strings with this library and output the resulting Unicode strings with disabled bidirectional algorithm. The font must be loaded with the code page cpUnicode in this  
case.  
  
The bidi mode is ignored during EMF conversion. To enable the bidirectional algorithm during EMF  
conversion you must set the flag ApplyBidiAlgo with [DynaPDF.SetMetaConvFlags](DynaPDFSetMetaConvFlags.md).  
See also [SetBidiMode](https://www.monkeybreadsoftware.com/DynaPDF-Manual/SetBidiMode.shtml) function in DynaPDF manual.

### Examples

Set right to left:

 Set Variable \[ $r ; Value: MBS ( "DynaPDF.SetBidiMode"; $PDF ; "RightToLeft" ) \]  
### See also

- [DynaPDF.GetBidiMode](DynaPDFGetBidiMode.md)
- [DynaPDF.GetPageMode](DynaPDFGetPageMode.md)
- [DynaPDF.New](DynaPDFNew.md)
- [DynaPDF.SetMetaConvFlags](DynaPDFSetMetaConvFlags.md)
- [DynaPDF.SetPageMode](DynaPDFSetPageMode.md)

### Release notes

- **Version 15.2**
    - Added [DynaPDF.SetBidiMode](https://www.mbsplugins.eu/DynaPDFSetBidiMode.shtml) and [DynaPDF.GetBidiMode](https://www.mbsplugins.eu/DynaPDFGetBidiMode.shtml) functions.

### Example Databases

- [DynaPDF/WriteFText](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/DynaPDF/WriteFText.shtml#4ScriptAnchor_)

### Blog Entries

- [Use complex text rendering with DynaPDF in FileMaker](https://www.mbsplugins.de/archive/2025-06-25/Use_complex_text_rendering_wit/monkeybreadsoftware_blog_filemaker)
- [News in MBS FileMaker Plugin 15.2](https://www.mbsplugins.de/archive/2025-05-13/News_in_MBS_FileMaker_Plugin_1/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 15.2pr4](https://www.mbsplugins.de/archive/2025-04-16/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 10th April 2025 , last changed 23th May 2025

  
[DynaPDF.SetBBox](DynaPDFSetBBox.md) - [DynaPDF.SetBookmarkDest](DynaPDFSetBookmarkDest.md)

[HTML Version](DynaPDFSetBidiMode.shtml)