dongyan3237 2013-12-04 07:20
浏览 65
已采纳

有可能在fpdf中嵌入fontawesome字体吗?

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

  • 写回答

2条回答 默认 最新

  • duanqiang6501 2013-12-04 07:25
    关注

    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.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 基于卷积神经网络的声纹识别
  • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 CSAPPattacklab
  • ¥15 一直显示正在等待HID—ISP
  • ¥15 Python turtle 画图
  • ¥15 stm32开发clion时遇到的编译问题