CodeIgniter Forums
Recommendations for PDF Creation Libraries? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forum-5.html)
+--- Forum: Libraries & Helpers (https://forum.codeigniter.com/forum-11.html)
+--- Thread: Recommendations for PDF Creation Libraries? (/thread-67874.html)



Recommendations for PDF Creation Libraries? - cyclist - 04-19-2017

Hi everyone,

I want to give users the option in my Web app to convert Web site content to a PDF to print or download.

I'm looking for recommendations for a PDF library which works well with ci, doesn't hog too much space and which has at least a decent chance of being supported for a while!

I tried MPDF and after an hour couldn't get it to work. I think some of the tutorials are out of date. If that is in fact the best one I'll spend another hour or two trying to make it work, but I'm thinking maybe there's a better option?

Thank you!


RE: Recommendations for PDF Creation Libraries? - Diederik - 04-19-2017

Whenever I need to generate a PDF I use DomPDF.

https://github.com/dompdf/dompdf


RE: Recommendations for PDF Creation Libraries? - xenomorph1030 - 04-20-2017

It really depends on your requirements as there are several PDF libraries. A recent project of mine ended up going with mPDF because of the language support.


RE: Recommendations for PDF Creation Libraries? - kilishan - 04-20-2017

As mentioned already, DOMPdf is pretty good and very portable since it's all in PHP. I've also had good luck with wkhtmltopdf which is a bit faster since it's a lower level command. Also, PDFtk is nice, and simple to install on a Linux server, when used in combo with [https://github.com/mikehaertl/php-pdftk]this PHP package[/url] becomes pretty simple to use.


RE: Recommendations for PDF Creation Libraries? - marksman - 04-20-2017

I use FPDF before and it works good for me Smile


RE: Recommendations for PDF Creation Libraries? - skunkbad - 12-21-2017

I felt the need to resurrect this old thread because I finally discovered wkhtmltopdf. I had been using dompdf for years, and dompdf is just almost impossible to make a layout that is complex. wkhtmltopdf makes dompdf seem like garbage. I created a few documents with it this morning, and didn't run into any rendering bugs or errors.


RE: Recommendations for PDF Creation Libraries? - burebista - 12-20-2018

(12-21-2017, 09:15 PM)skunkbad Wrote: I felt the need to resurrect this old thread because I finally discovered wkhtmltopdf. I had been using dompdf for years, and dompdf is just almost impossible to make a layout that is complex. wkhtmltopdf makes dompdf seem like garbage. I created a few documents with it this morning, and didn't run into any rendering bugs or errors.

how do you integrate wkhtmltopdf in codeigniter?
thank you.


RE: Recommendations for PDF Creation Libraries? - kilishan - 12-20-2018

I use php-pdftk to integrate with any PHP application.


RE: Recommendations for PDF Creation Libraries? - php_rocs - 12-20-2018

@cyclist,

I'm a huge fan of TCPDF ( https://github.com/bcit-ci/CodeIgniter/wiki/TCPDF-Integration ). It's been great for me.


RE: Recommendations for PDF Creation Libraries? - skunkbad - 12-20-2018

(12-20-2018, 12:08 PM)burebista Wrote:
(12-21-2017, 09:15 PM)skunkbad Wrote: I felt the need to resurrect this old thread because I finally discovered wkhtmltopdf. I had been using dompdf for years, and dompdf is just almost impossible to make a layout that is complex. wkhtmltopdf makes dompdf seem like garbage. I created a few documents with it this morning, and didn't run into any rendering bugs or errors.

how do you integrate wkhtmltopdf in codeigniter?
thank you.

See: https://github.com/mikehaertl/phpwkhtmltopdf