'How to create PDF file in Batch

I have a very large dataset in MySQL database that I want to export in PDF file.

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

They all working in similar way, prepare the complete data in html and feed 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 single query and generate that whole html.

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

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

Please suggest the best way to handle it.

Thanks



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source