Open nemoeric opened 3 months ago
I don't know what version of react-pdf you're using, but I'm battling with fontFamily
too because a regression in 3.4.4 has broken them entirely... Search for fontFamily in issues...
I had the same problem when using server-side render pdf.
I had the same problem when using server-side render pdf.I wonder if you or anyone have solved this problem?
So far no solutions... Workaround was to move to pdf-make for server side pdf rendering (and it's really lovely pdf generation library if you ask me)
Hey there,
I have looked at many posts but none seem to be discussing this situation.
Font.register() seems not to be properly working when used inside a React Server Component. Although when using the directive "use client", the font is working.
But my goal is to fetch data in a async server component, generate a PDF, and save it to vercel Blob to get a URL I will use for an e-signature later in my workflow. That's why I would like not to use "use client" and remain a server component.
I am using :
I made a simple test page to illustrate (./app/test/page.tsx)
DOES NOT WORK
When I declare "use client" directive at the top of this exact same code and custom font is loaded
And of course, if I do not declare "use client" and do not use custom font, it does work
Thanks for your help