Google Web Fonts and PDF generation from HTML with wkhtmltopdf

前端 未结 9 2136
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-11-30 18:58

I am using wkhtmltopdf to convert HTML files in PDF format; it gives surprisingly good results, rendering the PDF exactly as WebKit would do.

I am using Google Web F

9条回答
  •  [愿得一人]
    2020-11-30 19:27

    I've been struggling with this for about two days now, my advice to you if none of the answers above work for you:

    Install the font (ttf) in the machine that hosts the webserver and just require it in the css just like you would do with a common font.

    body{
        font-family: 'Lato';
    }
    

    Now wkhtmltopdf should be able to include the font

提交回复
热议问题