Puppeteer is very heavy to be installed in the same container that laravel is running on. There is Docker-powered stateless API for PDF files called Gotenberg, it's doing the same thing, and it's working in separated container
@ricko1311 ай бұрын
good to know
@silphium551011 ай бұрын
The biggest issues we've run into with the Browsershot/Puppeteer setup on the server (we're running RedHat Enterprise) are 1) setting the correct node path (we use NVM); and 2) tricky permissions errors. For the first, we had to run "nvm use" and "which node" to find the owner, and then add a constant to .env "NODE_BIN=/home/[userName]/.nvm/versions/node/[version]/bin/". Paths will vary, of course. For the second, we had to change the owner of both the php-fpm process and the storage/* and bootstrap/* directories in Laravel. There's not a lot of clarity about which user needs to own these items in order for everything to work correctly.
@xyczz11 ай бұрын
The solution that worked for me was to create a symlink between /usr/local/bin/npm and /usr/local/bin/node to the corresponding paths for my binaries (can be found with which node, which npm). Only problem I see is if I update npm or node I will likely have to create new symlinks to the new paths. I assume your .env solution is the same, i.e. you will have to update the values for version when updating node. Since I am testing locally I had no permission errors but I can definitely see that being an issue when working on a remote server with several users.
@franciscoogaldeАй бұрын
it's a nightmare! im using a self hosted (internal network) ubuntu 24.04 and i not able to make work in production.. in my mac runs perfect, but in the server problems after problems..
@rationalityfirst11 ай бұрын
Yay, node dependencies in production for a PHP site! The fun we missed.
@SXsoft9911 ай бұрын
been using them for some years
@Samuel.Mwangi11 ай бұрын
I have been using their spatie/browsershot package to generate invoices and its been fantastic. I imagine where before I had to first render the view then pass the html to the package now straight up passing the view is a great DX improvement. Kudos to the spatie team as always 👏
@ssodoloufo6 ай бұрын
Not work on windows. How to fixe it ?
@stefanrakic599111 ай бұрын
Looks great, but it's very tricky to install Puppeter on some linux servers
@8infinito811 ай бұрын
Absolutely amazing 😍. Styling PDF with Tailwind CSS it seems a miracle to me!
@1234matthewjohnson11 ай бұрын
still using the snappy :) works great
@DarellND10 ай бұрын
I always get "'node' is not recognized as an internal or external command, operable program or batch file." whenever I try saving the pdf. 🤔
@shadyarbzharothman86897 ай бұрын
Did you solve the problem?
@DarellND7 ай бұрын
@@shadyarbzharothman8689 yes. I needed to install nodejs globally. This package will not work on shared hosting.
@DarellND7 ай бұрын
@@shadyarbzharothman8689 looks like we need to install node and npm on our computers and set the paths manually if needed. This package will not work on shared hosting websites.
@403gtfo11 ай бұрын
Whoa... so many moving parts. My initial reaction was "talk about treading mud into the dates of hell" buuuuuut... anything that can make PDFs easier, I am all for.
@tal.gerafi11 ай бұрын
What about implementing tables, images, page breaks, big tables maybe with images? I think those are the main issues
@krekas11 ай бұрын
Page bake you can definitely do, there's a helper. Images should be a breeze. Should read the docs
@amir-raouaa10 ай бұрын
Have you a proposal how to use it with Filament?
@JUSTaGUYchannel8 ай бұрын
I need help. I keep getting an error that "the command 'node: ....... Error Output === 'node' is not recorgnized as an internal or external command, operable program or batch' Everything is installed on windows. Any help
@shadyarbzharothman86897 ай бұрын
Did you solve the problem?
@AbderrahmanFodili5 ай бұрын
same here . if you've solved it help us
@mansourahmed38414 ай бұрын
Why no download pdf only save
@tahinuralam5 ай бұрын
How to use in filament
@ssodoloufo6 ай бұрын
How can make it work in windows or ubuntu ?
@othmantabati375711 ай бұрын
do i have to install the chrome binaries on the server for this package to work ?
@VirusEcks11 ай бұрын
unfortunately yes so it wouldn't work on shared hosting
@krekas11 ай бұрын
when using laravel shared hosting shouldn't be used in first place
@anuzpandey105311 ай бұрын
Can you elaborate more on why is it bad practice to host laravel on shared hosting. @@krekas
@comemballage9 ай бұрын
Hello, I use spatie/browsershot for generating PDFs, but I have encountered some issues with it. When I use a simple view, it works normally. However, when I use a complex one, it fails. In this case, I added ->timeout(120), but it did not solve the overall problem. While it saved the PDF in the correct location, it returned a TimeoutError: Navigation timeout of 30000 ms exceeded. Could Anyone help?
@MishaAkopov11 ай бұрын
Finally! Great news
@azeroth567211 ай бұрын
it doesn't work.. error said something about not being able to access node js internally and externally. I can access node js globally in all folder via cmd. Not sure why the error said otherwise. Tried on existing project and new project. I've also made sure to use the latest laravel n php version, as well as satisfying other requirements such as puppeteer and browsershot. Not working.
@shadyarbzharothman86897 ай бұрын
Did you solve the problem?
@vidhyaprakash8511 ай бұрын
thanks... Just now i started to work
@Novia555511 ай бұрын
Nice Info 👍🏻👍🏻
@imranafzal0211 ай бұрын
I always follow your videos and it helped alot in code optimization. I am facing an issue in pdf generatin. I am trying to make a pdf using pdfdom that contains english and arabic, the english content displays corre tly but when it comes with arabic, it displays ????. can you pelase help me in this regard. i tried to include aeabic font as well but it didn't work
@LaravelDaily11 ай бұрын
Sorry I haven't used dompdf with arabic
@alirezabazargani13609 ай бұрын
set utf-8 meta tag in your view.
@nipunsachinda11 ай бұрын
can i use with boostrap?
@krekas10 ай бұрын
Yes
@kontributoronline11 ай бұрын
Thanks is exactly what I need
@AbderrahmanFodili11 ай бұрын
I wonder if it supports RTL
@krekas10 ай бұрын
Why wouldn't it?
@abhishekbhagat931311 ай бұрын
It throws some error, saying issue with puppeter, even after trying to install it and its the same
@LaravelDaily11 ай бұрын
Then it's probably something with your web server
@abhishekbhagat931311 ай бұрын
@@LaravelDaily actually when i am trying to work on local
@alirezabazargani13609 ай бұрын
@@abhishekbhagat9313your app is serving via a webserver even on local machine, too. so you need to set env of yours to be compatible.
@nabih.siblini11 ай бұрын
is it supporting arabic text?
@xyczz11 ай бұрын
Yes the package supports arabic text - you can have it in the blade view as well as fetching it stored in a database such as MariaDB or MySQL and passing it through the controller to a blade view
@muhammadrafay302111 ай бұрын
Can you show how to automatically backup a big database every day with Laravel on cPanel? Make a video, please!
@LaravelDaily11 ай бұрын
I don't use cpanel, sorry
@muhammadrafay302111 ай бұрын
@@LaravelDaily make overall large db backup . thank you
@krekas11 ай бұрын
use spatie backup package. that is all
@uluumbch11 ай бұрын
so basically that's just image right? I mean the text cannot be select and copy-paste?
@pilskalns11 ай бұрын
No, it is a text. Open the resume page link from video description.
@astrea42317 ай бұрын
They need to improve the documentation a lot since if you try to run the code for the first time, you will run into errors even if you're in localhost. It's becuz of Browershot needing node and puppeteer. You would need to add custom paths for node, npm and chrome. Even after all of that, I can't get it working becuz of puppeteer. There's no solutions regarding this problem
@lindor947 ай бұрын
Same here, after setting the paths, I still cant get get it running on Ubuntu 20.
@grzesiekb914211 ай бұрын
Unfortunately, I won't run this package on my VPS :(
@yu5uy11 ай бұрын
Thanks
@SanderCokart11 ай бұрын
This is huge
@Anonymous-cj4kk11 ай бұрын
The Arabic language also works perfectly
@wildfireDZ11 ай бұрын
5 seconds for one page pdf is kinda long
@alirezabazargani13609 ай бұрын
make a command to run in background.
@lindor947 ай бұрын
Thats what I taught, then I tried generating a table with 10.000 rows and it took maybe 20-25 seconds.
@SXsoft9911 ай бұрын
i can finally stop declaring styles for pdf
@maximilianberbechelov9 ай бұрын
Worst thing Spatie has ever created. Generate PDF in Laravel with 15 easily breakable dependencies in frontend. Let alone the fact that the git discussions are filled with one and the same error. Spatie are usually a symbol of quality for Laravel, but this is terrible.
@g.o.326211 ай бұрын
The worst thing about all those PDF creation packages is their slow speed. Good luck generating 100k documents…