Is possible to embed fontawesome font in fpdf?

0

Issue

I’d like to use fontawesome in pdf. I generate my pdf using php library fpdf and font embedding. However I cannot make it works.

I use this tool to generate afm file: http://fpdf.fruit-lab.de/

But when I try to use fontawesome I always get white square instead of icons.

I use this syntax to add icon:

MultiCell(0,8,"\uF000 ",0,'C')

enter image description here

Solution

I cannot answer for fpdf since I have never used it. However, I do use mPDF and there I use fontawesome regularly – no issues at all. The only thing I have to ensure is that the content I output to the PDF document (mPDF takes this in the form of HTML markup) hast to be UTF8 encoded.

mPDF is very good so if you are at an early stage of your project you might just consider switching to it. Otherwise, it is worth exploring whether you too are not running into a UTF8 encoding issue.

Answered By – DroidOS

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave A Reply

Your email address will not be published.

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More