Тёмный

New Spatie PDF Package: Use Tailwind Styles in PDF 

Laravel Daily
Подписаться 145 тыс.
Просмотров 14 тыс.
50% 1

Опубликовано:

 

29 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 74   
@mitanomar
@mitanomar 8 месяцев назад
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 8 месяцев назад
good to know
@amir-raouaa
@amir-raouaa 8 месяцев назад
Have you a proposal how to use it with Filament?
@comemballage
@comemballage 7 месяцев назад
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?
@stefanrakic5991
@stefanrakic5991 8 месяцев назад
Looks great, but it's very tricky to install Puppeter on some linux servers
@silphium5510
@silphium5510 8 месяцев назад
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 8 месяцев назад
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.
@JUSTaGUYchannel
@JUSTaGUYchannel 6 месяцев назад
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 5 месяцев назад
Did you solve the problem?
@AbderrahmanFodili
@AbderrahmanFodili 2 месяца назад
same here . if you've solved it help us
@tal.gerafi
@tal.gerafi 8 месяцев назад
What about implementing tables, images, page breaks, big tables maybe with images? I think those are the main issues
@krekas
@krekas 8 месяцев назад
Page bake you can definitely do, there's a helper. Images should be a breeze. Should read the docs
@rationalityfirst
@rationalityfirst 8 месяцев назад
Yay, node dependencies in production for a PHP site! The fun we missed.
@SXsoft99
@SXsoft99 8 месяцев назад
been using them for some years
@403gtfo
@403gtfo 8 месяцев назад
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.
@mansourahmed3841
@mansourahmed3841 Месяц назад
Why no download pdf only save
@DarellND
@DarellND 7 месяцев назад
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 5 месяцев назад
Did you solve the problem?
@DarellND
@DarellND 5 месяцев назад
@@shadyarbzharothman8689 yes. I needed to install nodejs globally. This package will not work on shared hosting.
@DarellND
@DarellND 5 месяцев назад
@@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.
@8infinito8
@8infinito8 8 месяцев назад
Absolutely amazing 😍. Styling PDF with Tailwind CSS it seems a miracle to me!
@tahinuralam
@tahinuralam 2 месяца назад
How to use in filament
@astrea4231
@astrea4231 4 месяца назад
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 4 месяца назад
Same here, after setting the paths, I still cant get get it running on Ubuntu 20.
@1234matthewjohnson
@1234matthewjohnson 8 месяцев назад
still using the snappy :) works great
@maximilianberbechelov
@maximilianberbechelov 7 месяцев назад
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.
@Anonymous-cj4kk
@Anonymous-cj4kk 8 месяцев назад
The Arabic language also works perfectly
@azeroth5672
@azeroth5672 8 месяцев назад
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 5 месяцев назад
Did you solve the problem?
@othmantabati3757
@othmantabati3757 8 месяцев назад
do i have to install the chrome binaries on the server for this package to work ?
@VirusEcks
@VirusEcks 8 месяцев назад
unfortunately yes so it wouldn't work on shared hosting
@krekas
@krekas 8 месяцев назад
when using laravel shared hosting shouldn't be used in first place
@anuzpandey1053
@anuzpandey1053 8 месяцев назад
Can you elaborate more on why is it bad practice to host laravel on shared hosting. @@krekas
@ssodoloufo
@ssodoloufo 4 месяца назад
How can make it work in windows or ubuntu ?
@SXsoft99
@SXsoft99 8 месяцев назад
i can finally stop declaring styles for pdf
@yu5uy
@yu5uy 8 месяцев назад
Thanks
@g.o.3262
@g.o.3262 8 месяцев назад
The worst thing about all those PDF creation packages is their slow speed. Good luck generating 100k documents…
@alirezabazargani1360
@alirezabazargani1360 7 месяцев назад
background commands.
@Samuel.Mwangi
@Samuel.Mwangi 8 месяцев назад
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 4 месяца назад
Not work on windows. How to fixe it ?
@wildfireDZ
@wildfireDZ 8 месяцев назад
5 seconds for one page pdf is kinda long
@alirezabazargani1360
@alirezabazargani1360 7 месяцев назад
make a command to run in background.
@lindor94
@lindor94 4 месяца назад
Thats what I taught, then I tried generating a table with 10.000 rows and it took maybe 20-25 seconds.
@uluumbch
@uluumbch 8 месяцев назад
so basically that's just image right? I mean the text cannot be select and copy-paste?
@pilskalns
@pilskalns 8 месяцев назад
No, it is a text. Open the resume page link from video description.
@nabih.siblini
@nabih.siblini 8 месяцев назад
is it supporting arabic text?
@xyczz
@xyczz 8 месяцев назад
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
@vidhyaprakash85
@vidhyaprakash85 8 месяцев назад
thanks... Just now i started to work
@kontributoronline
@kontributoronline 8 месяцев назад
Thanks is exactly what I need
@Novia5555
@Novia5555 8 месяцев назад
Nice Info 👍🏻👍🏻
@MishaAkopov
@MishaAkopov 8 месяцев назад
Finally! Great news
@imranafzal02
@imranafzal02 8 месяцев назад
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 8 месяцев назад
Sorry I haven't used dompdf with arabic
@alirezabazargani1360
@alirezabazargani1360 7 месяцев назад
set utf-8 meta tag in your view.
@SanderCokart
@SanderCokart 8 месяцев назад
This is huge
@AbderrahmanFodili
@AbderrahmanFodili 8 месяцев назад
I wonder if it supports RTL
@krekas
@krekas 7 месяцев назад
Why wouldn't it?
@muhammadrafay3021
@muhammadrafay3021 8 месяцев назад
Can you show how to automatically backup a big database every day with Laravel on cPanel? Make a video, please!
@LaravelDaily
@LaravelDaily 8 месяцев назад
I don't use cpanel, sorry
@muhammadrafay3021
@muhammadrafay3021 8 месяцев назад
​@@LaravelDaily make overall large db backup . thank you
@krekas
@krekas 8 месяцев назад
use spatie backup package. that is all
@nipunsachinda
@nipunsachinda 8 месяцев назад
can i use with boostrap?
@krekas
@krekas 7 месяцев назад
Yes
@abhishekbhagat9313
@abhishekbhagat9313 8 месяцев назад
It throws some error, saying issue with puppeter, even after trying to install it and its the same
@LaravelDaily
@LaravelDaily 8 месяцев назад
Then it's probably something with your web server
@abhishekbhagat9313
@abhishekbhagat9313 8 месяцев назад
@@LaravelDaily actually when i am trying to work on local
@alirezabazargani1360
@alirezabazargani1360 7 месяцев назад
@@abhishekbhagat9313your app is serving via a webserver even on local machine, too. so you need to set env of yours to be compatible.
@grzesiekb9142
@grzesiekb9142 8 месяцев назад
Unfortunately, I won't run this package on my VPS :(
Далее
Laravel Security: Top 7 Mistakes Developers Make
11:16
Top 5 Laravel "Bad Practices" (My Opinion)
10:32
Просмотров 22 тыс.
Дикий Бармалей разозлил всех!
01:00
Witch changes monster hair color 👻🤣 #shorts
00:51
КВН 2024 Встреча выпускников
2:00:41
.NET and C# are in trouble. Here is what I'd do.
10:57
File Upload in Laravel: Main Things You Need To Know
13:58
10 Tailwind Classes I Wish I Knew Earlier
13:31
Просмотров 186 тыс.