Right-to-left support
How DocStudio handles right-to-left documents: direction, mirrored alignment and tables, mixed-direction sections, bound-value isolation and font requirements.
English, Arabic and Urdu are the launch languages, and right-to-left is supported in the architecture from the start.
Set it up
{ "config": { "page": { "direction": "rtl" }, "locale": "ar" } }direction mirrors alignment, row order and table column order, and logical spacing. locale makes numbers and dates follow the language.
Mixed directions
A section can set direction for its children, so an English document can contain an Arabic note:
{ "id": "note", "type": "section", "config": { "direction": "rtl" }, "children": [] }Bound values
Bound values are wrapped in an isolating element, so a Latin name or a number inside Arabic text keeps its reading order.
What does not mirror
Fixed-region frames use the physical left and top, and the designer rulers are physical.
Fonts
Arabic and Urdu need a font that covers the script. Without a font from your application, the renderer falls back to the browser default. Provide fonts with createFontRegistry from docstudio/render. The package ships no fonts.
Limits
- The PDF text layer for Arabic and Urdu is lossy, so copying, searching and accessibility of text extracted from the PDF are degraded.
- Digit shapes and separators come from the runtime's
Intldata and can differ between Node and browser versions. Digits come out Latin in tested runtimes. - The designer interface supports right-to-left, and translations of its text are supplied by the host.
See the RTL feature page and the Arabic and Urdu guide.