Support the ongoing development of Laravel.io →
Laravel Vue.js
Last updated 1 year ago.
0

Hey!

What you could try is loading everything in multiple ajax requests (visit every single page of your pagination until no page is left) and push everything into a virtual div element which you'd then pass to the html2pdf function. But depending on the amount of the pages and the size of your items, this could easily lock your current browser session and become a huge memory hog.

A better way to do this would be to use a Laravel package like barryvdh/laravel-dompdf which takes everything from a custom view without paginated results and returns the PDF to the users browser to download it. So your server would do the work instead of the client.

0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.