Click here to Skip to main content
15,881,413 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have a very large dataset in the MySQL database that I want to export in a PDF file.

I am working in PHP and tried popular solutions like DOMPdf and Mpdf.

They all work in a similar way, preparing the complete data in HTML and feeding it to their functions to generate the PDF files.

My problem is that I cannot generate the whole HTML files at once and it is very resource-intensive to fetch complete data in a single query and generate that whole HTML.

I have already created a CSV file with that data. It was simple to do in batch as I can fetch a few entries from the database, write them in a file and then run the same process through Ajax to append the data.

I am looking for a similar solution to generate this large PDF file.

Please suggest the best way to handle it.

Thanks


What I have tried:

I tried using DOMPDF first but it wants all the HTML premade.
I also tried MPDF but it is slow and takes a lot of time to generate large HTML data into PDF.
Posted
Comments
[no name] 13-May-22 9:59am    
All you'll get is "guesses" because there is nothing to tell the observer what "very large" is; how efficient your queries are; the state the HTML is in; the speed of the computer you are using; etc.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900