*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
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?
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
@@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.
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.
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.