Globalization and RTL in Blazor SfPdfViewer Component

14 Oct 20251 minute to read

Localization

The Blazor SfPdfViewer component can be localized to display culture-specific text. Refer to the Blazor Localization guide for steps to add culture resource files, register localization services, and set the current culture.

NOTE

  • Provide localized string resources for the viewer’s UI texts (such as toolbar tooltips, dialog messages).
  • Ensure the app culture (CurrentCulture and CurrentUICulture) is set before the component renders for correct resource lookup.
  • Localization applies to the viewer UI; it does not translate the PDF document content.

Right to Left

To enable right-to-left (RTL) rendering for the viewer UI, set the EnableRtl property to true. This mirrors the layout and aligns UI elements for RTL languages such as Arabic, Hebrew, Azerbaijani, Persian, and Urdu. The following code snippet demonstrates how to enable RTL rendering.

By setting EnableRtl to true, the control will adjust its layout and appearance to align text, icons, and other elements from right to left, providing an optimized user experience for RTL language users.

@using Syncfusion.Blazor.SfPdfViewer

<SfPdfViewer2 Height="100%"
              Width="100%"
              DocumentPath="@DocumentPath"
              EnableRtl="true" />

@code {
    public string DocumentPath { get; set; } = "wwwroot/Data/PDF_Succinctly.pdf";
}

See also