Fix: Official Saudi Riyal Symbol via SVG Works in ERPNext Currency Doctype

السلام عليكم،

The official Saudi Riyal symbol released by the Saudi Central Bank (SAMA) is now available in SVG format and works perfectly inside the Currency.symbol field in ERPNext without any hacks or overrides.

:white_check_mark: This is the working HTML snippet to use in the SAR currency symbol field:

html

CopyEdit

<img src="https://www.sama.gov.sa/ar-sa/Currency/Documents/Saudi_Riyal_Symbol-2.svg" 
     style="height: 0.9em; vertical-align: middle;">

:mag: Tested:

  • Appears correctly in standard form views (like Sales Invoice)
  • Renders properly in print/PDF formats
  • Does not require any font install or JS injection

:white_check_mark: Optional Improvement: To avoid relying on external URLs (in case SAMA changes the file path), it’s recommended to self-host the SVG inside your custom app:

htm

<img src="/assets/your_app/images/sar-symbol.svg" 
     style="height: 0.9em; vertical-align: middle;">

:link: Official SAMA SVG Source:
https://www.sama.gov.sa/ar-sa/Currency/Documents/Saudi_Riyal_Symbol-2.svg

Thanks

1 Like

Tested with the above code, it show like this in print format
image

where the image takes the full width of the row cell,
I did a small update to specify the width, and now it work perfect.

Update code:
<img src="/files/saudi_riyal_symbol.svg" style="height: 1.25em; width: 1.5em !important; vertical-align: middle;">

After Update:
image

2 Likes