Тёмный

Generate PDFs in Laravel: A Deep Dive into Laravel PDF Export with Spatie/Browsershot 

QiroLab
Подписаться 18 тыс.
Просмотров 10 тыс.
50% 1

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

 

22 окт 2024

Поделиться:

Ссылка:

Скачать:

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

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 61   
@QiroLab
@QiroLab 9 месяцев назад
*Don't get left behind! Try Spec Coder: Supercharge Your Coding with AI!* 👉 qirolab.com/spec-coder TABLE OF CONTENTS 00:00 - Intro 00:37 - Introduction to Laravel browsershot package 02:19 - Create Laravel Application 03:15 - Install spatie/browsershot package 04:14 - Fix NODE & NPM binary path & Generate PDF 10:01 - Download PDF file 11:57 - Stream or Display PDF in the browser 13:10 - Generate PDF using Blade view file 17:38 - set PDF paper size 18:43 - PDF paper margins 19:14 - PDF Page break / add multiple pages, 20:31 - Set common header & footer for all pages 22:45 - Show page number and total pages in page footer 24:24 - Fix the image issue in the Header section 26:52 - Set font family and font size in PDF File 29:01 - Pass dynamic variables in PDF file 29:45 - refactoring pdf generator code and creating a `PDFWrapper` class 42:18 - Export Google Charts in PDF Support my work: 1. On BuyMeACoffee: www.buymeacoffee.com/qirolab DigitalOcean Referral m.do.co/c/e740238537d0 Also, follow us on: 𝐅𝐚𝐜𝐞𝐛𝐨𝐨𝐤: fb.com/qirolab 𝐓𝐰𝐢𝐭𝐭𝐞𝐫: twitter.com/qirolab
@violin245
@violin245 9 месяцев назад
Wow I needed this today!! Working on CMS for daycare that needs to create files
@QiroLab
@QiroLab 9 месяцев назад
I hope it will be helpful
@petermwangi7274
@petermwangi7274 9 месяцев назад
Great tutorial ✔✔❤. I think every Laravel app must utilize the package at some point.
@QiroLab
@QiroLab 9 месяцев назад
Thank you
@md.masudulislam3677
@md.masudulislam3677 5 месяцев назад
This is a great package but one question that has not been answered in this tutorial. The question is, for windows user setNodeBinary() or setIncludePath() actually takes the local machine path but how this path will be available in the production server? Server throws exception as usually mentioning that the path is not recognized. What is the solution of this problem?
@thierrydeville58
@thierrydeville58 9 месяцев назад
thank you very much for this tutorial... but after examining spatie's github account there is another one of laravel-pdf based on browsershot but returns the same error of npm and node not found
@thierrydeville58
@thierrydeville58 9 месяцев назад
sorry i found the solution by adding withbrowsershot function ...
@moviekit4220
@moviekit4220 6 месяцев назад
For Windows Users: Cache the configuration and then try it. Cache command: php artisan config:cache
@NatxoXI
@NatxoXI 5 месяцев назад
3 days... looking for a solution, nothing works. You are awesome, i love you today. So much thanks
@moviekit4220
@moviekit4220 5 месяцев назад
@@NatxoXI i'm glad it helped someone.😇😇
@demolocal-i5m
@demolocal-i5m 9 месяцев назад
Very Nice this tutorial is very help full for developers
@QiroLab
@QiroLab 9 месяцев назад
Glad to hear that
@tousifrafat
@tousifrafat 8 месяцев назад
Thank you for the video. It's very interesting and helpful.
@QiroLab
@QiroLab 8 месяцев назад
Glad it was helpful!
@bendo01
@bendo01 9 месяцев назад
thank you, this is great tutorial
@QiroLab
@QiroLab 9 месяцев назад
Glad you like it!
@thierrydeville58
@thierrydeville58 9 месяцев назад
thank you very much for this tutorial... Please show us your vscode configuration (extensions you are using)
@QiroLab
@QiroLab 9 месяцев назад
Sure, I am recording videos on VSCode settings and extensions. I will start uploading soon.
@thierrydeville58
@thierrydeville58 9 месяцев назад
Thanks you 🙏🙏
@ahmedsunil3235
@ahmedsunil3235 3 месяца назад
Page numbers not automcatic right? Is there any way?
@ahmadsaid5668
@ahmadsaid5668 3 месяца назад
thank you alot u r good person
@QiroLab
@QiroLab 2 месяца назад
So nice of you
@hasnathar9954
@hasnathar9954 5 месяцев назад
in production server not loading content of browsershot pdf
@videolocos413
@videolocos413 8 дней назад
I have problems displaying the image from the database in the header it does not show me anything.
@QiroLab
@QiroLab 5 дней назад
I've already explained the issue with displaying the image in the header in the video. You can check it out starting from the 24:24 mark.
@franciscoogalde
@franciscoogalde 3 дня назад
@@QiroLab in production doesnt work the extracted base_64 image, i think is a memory issue (Error: Unable to launch a new process) , if i remove the image tag from header work fine both in local and production.
@R0b3
@R0b3 6 месяцев назад
In prod envarioment, doesn't work... In local machine yes. Works great
@QiroLab
@QiroLab 6 месяцев назад
What error you are getting in prod environment
@joaopoliceno8844
@joaopoliceno8844 8 месяцев назад
Very good.
@QiroLab
@QiroLab 8 месяцев назад
Many many thanks
@kyopan23
@kyopan23 7 месяцев назад
Is it possible to export data to an existing fillable PDF?
@QiroLab
@QiroLab 6 месяцев назад
You can leverage Laravel's templating engine (Blade or similar) to create the initial PDF with fillable form fields pre-populated with your data. Then, use Browsershot to render that HTML template as the PDF.
@emmanuelsofuwa280
@emmanuelsofuwa280 9 месяцев назад
has anyone used this package succesfully? because I get a lot of errors
@Codeingday
@Codeingday 8 месяцев назад
😂😂😂 same pinch🙌
@QiroLab
@QiroLab 8 месяцев назад
I think you are running this on windows. To make it work you need to figure out the node and npm path.
@bala3508
@bala3508 8 месяцев назад
​@@QiroLabit didn't work
@KasimSheyi
@KasimSheyi 6 месяцев назад
Kept on getting node errors.
@nasermetani3956
@nasermetani3956 7 месяцев назад
Does it support UTF-8 Characters?
@QiroLab
@QiroLab 7 месяцев назад
yes, it does
@sayedahmadnaweed1
@sayedahmadnaweed1 Месяц назад
Is this project dockerized?
@QiroLab
@QiroLab Месяц назад
No, it is not dockerized
@sayedahmadnaweed1
@sayedahmadnaweed1 Месяц назад
@@QiroLab Thank you, I need the dockerized repo of this stack. Let me know if you have any link.
@shakilsikder-lf7ge
@shakilsikder-lf7ge 4 месяца назад
How to handl two lac PDF's generate in laravel 10
@Viralnursing
@Viralnursing 2 месяца назад
Use queues
@meritekioungou7489
@meritekioungou7489 9 месяцев назад
Did you do this on Windows or MacOS?
@QiroLab
@QiroLab 9 месяцев назад
I implemented this on Ubuntu. It will work on Windows and MacOS as well.
@meritekioungou7489
@meritekioungou7489 9 месяцев назад
@@QiroLab I tried on windows but I got errors
@QiroLab
@QiroLab 9 месяцев назад
It should work on windows as well. What errors you get?
@meritekioungou7489
@meritekioungou7489 9 месяцев назад
@@QiroLab The command ""C:\Program Files odejs ode.exe" "D:\Training\Laravel\laravel-pdf-tutorial-using-spatie-browsershot\vendor\spatie\browsershot\src/../bin/browser.cjs
@FaisalAhmed-zy5fl
@FaisalAhmed-zy5fl 6 месяцев назад
is it support bangla font?
@QiroLab
@QiroLab 5 месяцев назад
Yes, you can use any font
@a.j.t.2714
@a.j.t.2714 8 месяцев назад
People that are using this within windows will run into erros. And it seems it is not compatible for windows. Currently Mac and Ubuntu users can use this package without problems.
@QiroLab
@QiroLab 8 месяцев назад
I am not a Windows user, But I think it should work on Windows as well. For that, you need to figure out the node and npm path.
@denniskainga6970
@denniskainga6970 6 месяцев назад
@@QiroLab Bro it doesnt why dont you take it from someone who has tried
@angiethorne9025
@angiethorne9025 7 месяцев назад
'Promo SM'
Далее
Generate PDF from HTML Using Laravel Snappy Package
28:33
DIY Pump Solutions
00:18
Просмотров 1,5 млн
I tricked MrBeast into giving me his channel
00:58
Просмотров 4,6 млн
Laravel + Livewire todo app (and so much more)
16:41
Просмотров 48 тыс.
Generate PDF files in Laravel 11 using DomPDF Package
15:50
The Laravel Ecosystem - Livewire 🐙
7:07
Просмотров 11 тыс.
New Spatie PDF Package: Use Tailwind Styles in PDF
3:18