I want to make a PDF file which will contain huge data such as 12 months data. Each month contain 500 rows from MySQL table. I have tried with FPDF but it takes too much time that is unacceptable. If there is any other better PHP library or class to make it easily and not make the system busy?
If there is any script which will take 12 months data one month by one month and write it to PDF one by one and finally create the PDF file?
I routinely create very large PDFs from PHP using (usually) the same method. First I create a web page version of the document and output that to a file. Then I run the file through wkhtmltopdf. I've had consistently more success with this method than any other. The HTML should be quick to generate and wkhtmltopdf is surprisingly fast and efficient. Plus you can use CSS3 techniques for elaborate formatting.
For extremely large PDFs I've also generated smaller ones and then merged them with pdfmeld. This also gives you the option of adding bookmarks.
Building a PDF is always very long. If you have a huge amount of ressource, it will be very very long, you can't avoid that. I can see one way of doing it a way that is softer for your users :
Sending them a html render, and then with Ajax make the pdf generation asynchronous. So you can display a status bar. and inform your users your are performing their demand.
Then the generation can be technicaly performed by three ways :
proc_open
to ask the latex compilator to build a pdf file. It is a really fast and reliable tool but it needs you to have a dedicated server and not a shared host.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With