We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Pdf generation

Hi!

So it's been few days i tried to include a html to pdf library. I tried mpdf and others, and each time i've got errors I can't understand.

In my autoloader i've got $loader->registerNamespaces(array()) for my classes. I tried to had a $loader->registerDirs() for non-namespace. I also tried registerClasses... but i can't achieve to have ma mpdf class ok!

Is anyone already worked with an html to pdf converter in Phalcon ?

Thanks a lot

Alex



58.4k

What is library used it ?



8.2k

I simply trying to include mpdf to my project. I'm working with namespace but mpdf doesn't. And i can't achieve to have it 100% working :/

Create your own Class Loader, or just include mpdf class(es) file(s) for every request.



5.1k

I really recommend using composer. There is package with mpdf available: https://packagist.org/packages/mpdf/mpdf Composer autoload will take care of loading all clases, just include you vendor autoload to you your application boostrap. It's always better to keep your externals manageable with tools like composer or bower. You can easily switch between versions, resolve conflicts etc.



8.2k

Hi, thanks for the trick. I'm gonna give a try with composer!



8.2k

And i confirm it's 100% working! Thanks for answers!