79

In Coldfusion, some Arabic characters do not appear in PDF

 4 years ago
source link: https://www.codesd.com/item/in-coldfusion-some-arabic-characters-do-not-appear-in-pdf.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

In Coldfusion, some Arabic characters do not appear in PDF

advertisements

Some of the Arabic characters are not displaying in PDF. Do I need to add any font in ColdFusion Administrator I gave المينــاء as input inside the tag CFDOCUMENT to show in PDF format.

In PDF, the output I am getting is اينــاء instead of المينــاء.

Please advice. Thanks in advance.


You can use fontembed attribute of cfdocument and set it to true to embed the specified fonts in the output. You need to wrap your text inside span and specify the suitable font-family (font-family that displays your text better as required) in its style attribute. As @bibin suggested use Arial Unicode MS as the font-family. Like this:

<cfdocument format="PDF" overwrite="true" fontembed="true">
    <span style="font-size:20pt;font-family:Arial Unicode MS;">
        المينــاء
    </span>
</cfdocument>

Another font-family able to display the text is Traditional Arabic. You can install other more accurate font in CF Admin if you find one, and use it as a font family.

Update:

In my case the font is already available in CF Admin. So here fontEmbed is not really needed. It is helpful in case the font is not available in CF Admin and we want to use the font directly from CF page.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK