There is a task - to dynamically generate a string with html code and on the basis of it to generate a pdf file (using the html-pdf package). Naturally, everything in this pdf should be styled as the customer wants.
The customer provides otf files of fonts that are needed.
Inside the style tag, I embed the following line:
import { join } from "path"; const path = join(process.cwd(), "/src/templates/fonts"); export const fonts = ` @font-face { font-family: "proximanova"; src: url("${ path }/ProximaNova/ProximaNova-Regular.otf") format("opentype"); font-style: normal; font-weight: normal; } `; I'm testing this whole thing. For completeness, I generate not only a pdf file, but I also place a html file next to it.
So when I open the html file in the browser, the fonts are normally picked up.
And in pdf there.
Is it possible to zainlaynit otf file in the style tag?
src: url(data:font/opentype;charset=utf-8;base64,) format("woff");. only I wouldn’t take a phantom-based work of art; it’s more promising to take github.com/GoogleChrome/puppeteer - nörbörnën February