views:

49

answers:

2

Hello,

Just a quickie. I have tested DOMPDF in a Doctrine enabled Codeigniter 1.7.2 installation and everything works fine. However, when the Cart library and URL Helper are autoloaded as well, DOMPDF doesn't work. BUT, if you 'un-autoload' (ie. dont use) any one of Doctrine, the URL Helper or the Cart Library, DOMPDF works.

Is just a bit annoying as I need DOMPDF, Doctrine, the URL helper and the Cart Library all working together.

Could anyone suggest anything please. Any help very gratefully recieved.

Regards,

Matt

A: 

mPDF is bloody brilliant and much much better than domPDF, it works in the same way too in that it reads in a html file with your php code placeholders or whatever to add the dynamic content. I have written a small tutorial on how to use it with Codeigniter if you need it.

audiopleb
Hello Audiopleb,Yes that would be great, just downloading it now. Big, at 17.7mb! Where can I access this tutorial please?
Matt
http://www.badcaffeine.com/blog/Using-mpdf-with-codeigniter-to-generate-pdfs-from-html-and-css/ - Enjoy!
audiopleb
Fantastic, thank you! I'll have a read of this now but it looks a great tutorial, and nice website too. Thank you very much.
Matt
No problem, DOMPDF used to do my bloomin head in!
audiopleb
Hmmm, just loading the mpdf library is causing a basic installation of CI to break at the moment. I've followed the badcaffine tutorial so the only thing I can assume to be wrong is the path variable in mpdf.php, though I've tried lots of variations...
Matt
A: 

If you're using DOMPDF 0.5.1 you could be running into conflicts between the __autoload() methods used by the various libraries. The 0.6.0 code base (currently in beta) has been updated to use spl_autoload_register() which helps to prevent auto-loading conflicts between different libraries.

BrianS
Thanks Brian, I'll check what version I am running and get back to you (in the office at the moment).
Matt
Kind regards,Matt
Matt
Hello Brian, I just checked and I am using the 0.6.0 beta unfortunately. Do you have any other idea what may be causing this please?
Matt
Everything works ok until it gets to $dompdf->render(); and then it fails
Matt
It sounds like it could be an autoload issue. I believe up until that point DOMPDF doesn't load any of its classes. What PHP errors are being thrown (you might have to adjust your error reporting)?
BrianS