-->

INR currency symbol on pdf using dompdf

2019-04-16 00:25发布

问题:

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?

回答1:

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.