New Spatie PDF Package: Use Tailwind Styles in PDF

  Рет қаралды 15,491

Laravel Daily

Laravel Daily

Күн бұрын

Пікірлер: 75
@mitanomar
@mitanomar 11 ай бұрын
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
@ricko13
@ricko13 11 ай бұрын
good to know
@silphium5510
@silphium5510 11 ай бұрын
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.
@xyczz
@xyczz 11 ай бұрын
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
@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..
@rationalityfirst
@rationalityfirst 11 ай бұрын
Yay, node dependencies in production for a PHP site! The fun we missed.
@SXsoft99
@SXsoft99 11 ай бұрын
been using them for some years
@Samuel.Mwangi
@Samuel.Mwangi 11 ай бұрын
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 👏
@ssodoloufo
@ssodoloufo 6 ай бұрын
Not work on windows. How to fixe it ?
@stefanrakic5991
@stefanrakic5991 11 ай бұрын
Looks great, but it's very tricky to install Puppeter on some linux servers
@8infinito8
@8infinito8 11 ай бұрын
Absolutely amazing 😍. Styling PDF with Tailwind CSS it seems a miracle to me!
@1234matthewjohnson
@1234matthewjohnson 11 ай бұрын
still using the snappy :) works great
@DarellND
@DarellND 10 ай бұрын
I always get "'node' is not recognized as an internal or external command, operable program or batch file." whenever I try saving the pdf. 🤔
@shadyarbzharothman8689
@shadyarbzharothman8689 7 ай бұрын
Did you solve the problem?
@DarellND
@DarellND 7 ай бұрын
@@shadyarbzharothman8689 yes. I needed to install nodejs globally. This package will not work on shared hosting.
@DarellND
@DarellND 7 ай бұрын
@@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.
@403gtfo
@403gtfo 11 ай бұрын
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.gerafi
@tal.gerafi 11 ай бұрын
What about implementing tables, images, page breaks, big tables maybe with images? I think those are the main issues
@krekas
@krekas 11 ай бұрын
Page bake you can definitely do, there's a helper. Images should be a breeze. Should read the docs
@amir-raouaa
@amir-raouaa 10 ай бұрын
Have you a proposal how to use it with Filament?
@JUSTaGUYchannel
@JUSTaGUYchannel 8 ай бұрын
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
@shadyarbzharothman8689
@shadyarbzharothman8689 7 ай бұрын
Did you solve the problem?
@AbderrahmanFodili
@AbderrahmanFodili 5 ай бұрын
same here . if you've solved it help us
@mansourahmed3841
@mansourahmed3841 4 ай бұрын
Why no download pdf only save
@tahinuralam
@tahinuralam 5 ай бұрын
How to use in filament
@ssodoloufo
@ssodoloufo 6 ай бұрын
How can make it work in windows or ubuntu ?
@othmantabati3757
@othmantabati3757 11 ай бұрын
do i have to install the chrome binaries on the server for this package to work ?
@VirusEcks
@VirusEcks 11 ай бұрын
unfortunately yes so it wouldn't work on shared hosting
@krekas
@krekas 11 ай бұрын
when using laravel shared hosting shouldn't be used in first place
@anuzpandey1053
@anuzpandey1053 11 ай бұрын
Can you elaborate more on why is it bad practice to host laravel on shared hosting. @@krekas
@comemballage
@comemballage 9 ай бұрын
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?
@MishaAkopov
@MishaAkopov 11 ай бұрын
Finally! Great news
@azeroth5672
@azeroth5672 11 ай бұрын
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.
@shadyarbzharothman8689
@shadyarbzharothman8689 7 ай бұрын
Did you solve the problem?
@vidhyaprakash85
@vidhyaprakash85 11 ай бұрын
thanks... Just now i started to work
@Novia5555
@Novia5555 11 ай бұрын
Nice Info 👍🏻👍🏻
@imranafzal02
@imranafzal02 11 ай бұрын
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
@LaravelDaily
@LaravelDaily 11 ай бұрын
Sorry I haven't used dompdf with arabic
@alirezabazargani1360
@alirezabazargani1360 9 ай бұрын
set utf-8 meta tag in your view.
@nipunsachinda
@nipunsachinda 11 ай бұрын
can i use with boostrap?
@krekas
@krekas 10 ай бұрын
Yes
@kontributoronline
@kontributoronline 11 ай бұрын
Thanks is exactly what I need
@AbderrahmanFodili
@AbderrahmanFodili 11 ай бұрын
I wonder if it supports RTL
@krekas
@krekas 10 ай бұрын
Why wouldn't it?
@abhishekbhagat9313
@abhishekbhagat9313 11 ай бұрын
It throws some error, saying issue with puppeter, even after trying to install it and its the same
@LaravelDaily
@LaravelDaily 11 ай бұрын
Then it's probably something with your web server
@abhishekbhagat9313
@abhishekbhagat9313 11 ай бұрын
@@LaravelDaily actually when i am trying to work on local
@alirezabazargani1360
@alirezabazargani1360 9 ай бұрын
@@abhishekbhagat9313your app is serving via a webserver even on local machine, too. so you need to set env of yours to be compatible.
@nabih.siblini
@nabih.siblini 11 ай бұрын
is it supporting arabic text?
@xyczz
@xyczz 11 ай бұрын
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
@muhammadrafay3021
@muhammadrafay3021 11 ай бұрын
Can you show how to automatically backup a big database every day with Laravel on cPanel? Make a video, please!
@LaravelDaily
@LaravelDaily 11 ай бұрын
I don't use cpanel, sorry
@muhammadrafay3021
@muhammadrafay3021 11 ай бұрын
​@@LaravelDaily make overall large db backup . thank you
@krekas
@krekas 11 ай бұрын
use spatie backup package. that is all
@uluumbch
@uluumbch 11 ай бұрын
so basically that's just image right? I mean the text cannot be select and copy-paste?
@pilskalns
@pilskalns 11 ай бұрын
No, it is a text. Open the resume page link from video description.
@astrea4231
@astrea4231 7 ай бұрын
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
@lindor94
@lindor94 7 ай бұрын
Same here, after setting the paths, I still cant get get it running on Ubuntu 20.
@grzesiekb9142
@grzesiekb9142 11 ай бұрын
Unfortunately, I won't run this package on my VPS :(
@yu5uy
@yu5uy 11 ай бұрын
Thanks
@SanderCokart
@SanderCokart 11 ай бұрын
This is huge
@Anonymous-cj4kk
@Anonymous-cj4kk 11 ай бұрын
The Arabic language also works perfectly
@wildfireDZ
@wildfireDZ 11 ай бұрын
5 seconds for one page pdf is kinda long
@alirezabazargani1360
@alirezabazargani1360 9 ай бұрын
make a command to run in background.
@lindor94
@lindor94 7 ай бұрын
Thats what I taught, then I tried generating a table with 10.000 rows and it took maybe 20-25 seconds.
@SXsoft99
@SXsoft99 11 ай бұрын
i can finally stop declaring styles for pdf
@maximilianberbechelov
@maximilianberbechelov 9 ай бұрын
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.3262
@g.o.3262 11 ай бұрын
The worst thing about all those PDF creation packages is their slow speed. Good luck generating 100k documents…
@alirezabazargani1360
@alirezabazargani1360 9 ай бұрын
background commands.
4 Problems with Eloquent Soft Deletes (and Two Alternatives)
9:05
Laravel Daily
Рет қаралды 11 М.
Laravel: Change Two Symbols to Boost Eloquent Speed
6:34
Laravel Daily
Рет қаралды 87 М.
IL'HAN - Qalqam | Official Music Video
03:17
Ilhan Ihsanov
Рет қаралды 700 М.
Мен атып көрмегенмін ! | Qalam | 5 серия
25:41
СИНИЙ ИНЕЙ УЖЕ ВЫШЕЛ!❄️
01:01
DO$HIK
Рет қаралды 3,3 МЛН
ChatGPT for Laravel Devs: 9 Use-Cases You May Not Think About
9:44
Convert PDF from Laravel Blade file with DOMPDF laravel package
18:03
How to Use Events and Listeners in Laravel Step-by-Step
14:49
VFIX TECHNOLOGY
Рет қаралды 144
Laravel Security: Top 7 Mistakes Developers Make
11:16
Laravel Daily
Рет қаралды 87 М.
Got a New Laravel Job? 3 Tips to Analyze Project Codebase Fast
7:23
Laravel Daily
Рет қаралды 3,4 М.
4 Packages You Need in ANY Laravel Project
8:14
Laravel Daily
Рет қаралды 62 М.
What’s Up with Laravel? It’s Everywhere, and Here’s Why!
6:22
IL'HAN - Qalqam | Official Music Video
03:17
Ilhan Ihsanov
Рет қаралды 700 М.