How to use font-family in jspdf

75 Views Asked by At

In CSS, we can use font-family to render multi fonts, for example:

font-family: Roboto, ZhiMangXing;

If Roboto not support, browser will use ZhiMangXing to render the text;

But in jsPDF, we can only use setFont api, not font-family; Is it possible to use font-family in jspdf? Or is there any hack method to do that?

This is my demo https://codesandbox.io/s/stoic-firefly-jpqtld?file=/public/index.html

In this demo, the webpage render the text correctly with css The two button download the pdf, but have some font problem

I have tried pdfmake, no luck

0

There are 0 best solutions below