Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

INR currency symbol on pdf using dompdf

I am using dompdf to create a pdf. When I pass ₹ to pdf it converts into ?

How I can show indian currency symbol in pdf using dompdf?

like image 491
Harish Singh Avatar asked Nov 29 '22 00:11

Harish Singh


1 Answers

The core PDF fonts (Helvetica, Times Roman, Courier) in dompdf only support characters that are included in Windows ANSI. Additionally, though dompdf 0.5.x can display other characters it requires much work to set up.

With dompdf 0.6.0 full Unicode character support is enabled so long as you have loaded a font that covers your character set. dompdf 0.6.0 (currently in beta) includes the DejaVu fonts, which do support ₹. Displaying that character requires only something like the following:

<span style="font-family: DejaVu Sans; sans-serif;">&#8377;</span>

For more details on configuring dompdf with Unicode support see the Unicode How-to on the dompdf wiki.

like image 126
BrianS Avatar answered Dec 01 '22 12:12

BrianS