marcbachmann / node-html-pdf

This repo isn't maintained anymore as phantomjs got dreprecated a long time ago. Please migrate to headless chrome/puppeteer.
MIT License
3.56k stars 545 forks source link

any idea how to add custom font? #628

Open fallenmel opened 3 years ago

JorgeNava commented 3 years ago

Try converting your font (mine was on .tff format) to base64 and paste the base64 string given to the url element on a @font-face declaration on your css. Heres an example:

example-1.txt

Hope you find this usefull.