Print HTML containing fonts Amazing Badges with wkhtmltopdf

I want to print an HTML page containing awesome font icons, c wkhtmltopdf. I saw this issue with Google fonts: Google Web Fonts and PDF education from HTML using wkhtmltopdf , but this method does not work.

+4
source share
3 answers

Add the .woff file to your Font Awesome lib dir (without base64 in css) and it should work.

0
source

Do you have any examples?

In this question, I saw something similar: https://github.com/mileszs/wicked_pdf/issues/587

, . , , .

+1

, TTF- :

<style type="text/css">
@font-face {
    font-family: 'FontAwesome';
    src: url(data:application/x-font-truetype;base64,<< insert base64 encoded fontawesome-webfont.ttf here >>) format('truetype');
    font-weight: normal;
    font-style: normal;
}
</style>

font-awesome.css. @font-face , wkhtmltopdf @font-face, . , RegEx, at (: @font-face\s*\{[^\}]*\}).

(I tried to leave the original @font-faceintact, hoping that a later definition would overwrite it, but that didn't work. The CSS standard doesn't seem to define what happens when two appear @font-facefor the same font if I read it correctly)

0
source

All Articles