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.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community