Can't download PDF using Spatie Laravel-pdf

I'm trying to use Spatie Laravel-pdf to generate PDF with the use of Tailwing and tried following the docs https://spatie.be/docs/laravel-pdf/v1/advanced-usage/using-tailwind . However, after installing puppeter I'm still getting problem (pic related). I've read https://github.com/spatie/laravel-pdf/discussions/57 and tried doing the same in my app.dockerfile since I'm using ddev container to launch my app.
RUN { \
echo 'memory_limit = 80GB'; \
} > /usr/local/etc/php/conf.d/docker-php-memory-limit.ini
RUN { \
echo 'memory_limit = 80GB'; \
} > /usr/local/etc/php/conf.d/docker-php-memory-limit.ini
But this didn't work. Any ideas?
GitHub
Error: Failed to launch the browser process! · spatie laravel-pdf ...
I have a working installation on my Mac, but when trying to run the pdf creation process on AlmaLinux 8, I get this error: The command "PATH=$PATH:/usr/local/bin:/opt/homebrew/bin NODE_PATH=np...
No description
6 Replies
lukaveck1
lukaveck1OP2mo ago
https://www.youtube.com/watch?v=QjoIpJj8qxU Reading the comments right now, sounds like this is a bit tricky after all.
Laravel Daily
YouTube
New Spatie PDF Package: Use Tailwind Styles in PDF
Presenting another new package by Spatie. Links mentioned in the video: - Official repo: https://github.com/spatie/laravel-pdf - Official tutorial: "Easily create PDFs in Laravel apps" https://freek.dev/2625-easily-create-pdfs-in-laravel-apps - Tutorial "Creating beautiful invoices using Tailwind and Laravel PDF" https://freek.dev/2639-creating...
ARKAR KYAW
ARKAR KYAW3d ago
Same Here. Any solution did you found?
Julien B. (aka yebor974)
Hello, have you installed the dependencies like "puppeteer"? I'm using version ^17.1.3 for it to work. Also, in production, I need to add some parameters to Browsershot to set the associated paths. Here’s an example:
$browsershot
->setCustomTempPath(config('project.browsershot.customer_temp_path'))
->setNodeModulePath(config('project.browsershot.node_module_path'))
->setNodeBinary(config('project.browsershot.node_binary'))
->setNpmBinary(config('project.browsershot.npm_binary'))
->setChromePath(config('project.browsershot.chrome_path'));
$browsershot
->setCustomTempPath(config('project.browsershot.customer_temp_path'))
->setNodeModulePath(config('project.browsershot.node_module_path'))
->setNodeBinary(config('project.browsershot.node_binary'))
->setNpmBinary(config('project.browsershot.npm_binary'))
->setChromePath(config('project.browsershot.chrome_path'));
Julien B. (aka yebor974)
I’m thinking about writing a short article on Filament Mastery about this topic to explain the setup more in detail. What do you think?
Filament Mastery
Filament Mastery
Discover Filament Mastery, your go-to platform for all things FilamentPHP. Dive into tutorials, articles, plugins, and tips to level up your Laravel development projects with ease and efficiency.
RawaN
RawaN3d ago
Actually I had same issue on production
Julien B. (aka yebor974)
Have you add Browsershot path params ?

Did you find this page helpful?