Replies: 5 comments 1 reply
-
In the end, downloading from googleapis with a |
Beta Was this translation helpful? Give feedback.
-
I was going to recommend converting the font to base64. That's how I got it to work.
Glad you got it working. Question.. How did you get PDF to save correctly? I'm on windows 11, running locally and can save images, but errors on pdf's for some reason. Are you using puppeteer in your project or globally? |
Beta Was this translation helpful? Give feedback.
-
base64 was going to be my next move. I'm using puppeteer. Saving the pdf goes without a hitch -- at least locally. On the server, we're still dealing with some node permissions issues. Mysterious errors are such a pain. I thank my lucky stars that it works for me. |
Beta Was this translation helpful? Give feedback.
-
I'm on a Mac. Initially I had an if/else along similar lines for the node path. I've since changed it to a environment variable (using Laravel): Browsershot::html($html)
->setNodeBinary(config('constants.node_bin') . 'node')
->setNpmBinary(config('constants.node_bin') . 'npm')
[etc]
The server is running Red Hat enterprise. A colleague is going to try and address the server permissions thing ...soon... . |
Beta Was this translation helpful? Give feedback.
-
This is the only thing that solved it for me:
|
Beta Was this translation helpful? Give feedback.
-
Using Laravel 9, Inertia, Vue 3, and Vite. I am using Browsershot to generate and save a PDF from a blade view file, and cannot get the PDF use a Google font. I've tried using both @font-face and a local URL (used asset() and absolute URL) and downloading the font on the fly from googlapis. If I display only the html view in the borwser, the font is correct. But the saved PDF only has Helvetica. Right now I'm working locally, so there are no network issues. No errors. What do I have to do to get the custom font (in this case, Red Hat Display) into the PDF?
Beta Was this translation helpful? Give feedback.
All reactions