spipu / html2pdf

OFFICIAL PROJECT | HTML to PDF converter written in PHP
http://html2pdf.fr/en/default
Open Software License 3.0
1.68k stars 750 forks source link

How to add font-awesome icon ? #457

Open Sivanime opened 5 years ago

Sivanime commented 5 years ago

Hi,

I read the documentation on https://tcpdf.org/docs/fonts/.

I try this :

TCPDF_FONTS::addTTFfont(DOCUMENT_ROOT . '/librairies/font-awesome/fonts/fontawesome-webfont.ttf', 'TrueTypeUnicode', '', 96);

In HTML :

<style> // Content of font-awesome.css </style> TEST : <i class="fa fa-envelope fa-11x"></i>

It doesn't work. Any help please.

xmgr commented 5 years ago

Hi,

@Sivanime maybe the libs folder is not spelled correctly: "librairies" <-> "libraries" (drop the 2nd "i").

picocodes commented 2 years ago

Did you ever get this to work?

boussou commented 2 years ago

ttf fonts shall be converted.

otherwise you shall try to use SVG/ but there is limited support for this.

Sivanime commented 2 years ago

Hi, thanks for the replies event after 3 years :)

I cannot remember how I fixed it. Maybe, the path of the library.