CodeIgniter Forums
dompdf - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: dompdf (/showthread.php?tid=54316)



dompdf - El Forum - 09-03-2012

[eluser]jtan[/eluser]
Is there official way where to put DOMPDF folder on CodeIgniter? Or same folder/level with Application?

My settings are correct and samples are all working fine but my DOMPDF is not working correctly.


dompdf - El Forum - 09-03-2012

[eluser]solid9[/eluser]
yes the same level with application and system.


dompdf - El Forum - 09-03-2012

[eluser]jtan[/eluser]
do I miss anything, the setup of DOMPDF change the default paper size to A5 when I set it to A5 but when I generate PDF, it's still letter size..


dompdf - El Forum - 09-06-2012

[eluser]claudia_ef[/eluser]
Hi! I was trying several times configure dompdf as a helper en CI 2.0. But it does not work out.
Path where I have dompdf: /application/helpers/dompdf
Dompdf helper: /application/helpers/to_dompdf_helper.php
/******************************/
<?php
if(!defined('BASEPATH')) exit('No direct script access allowed');

function to_dompdf($html){
require_once("dompdf/dompdf_config.inc.php");
$dompdf=new DOMPDF();
$dompdf->load_html($html);
$dompdf->set_paper('letter', 'landscape');
$dompdf->render();
$dompdf->stream("hello_world.pdf");
}
/******************************/
?>
This function is executing in a test view.
I've added dompdf helper in the helper array in /application/config/autoload.php

I realized when I created the object, this didn't show its methods. Always shows this error:

Fatal error: Call to undefined method Dompdf::load_html() in /var/www/dashdev2.serverxyz.com/application/helpers/to_dompdf_helper.php on line 8

I don't know If I'm doing something wrong.

Please, need your help. Thanks.




dompdf - El Forum - 09-06-2012

[eluser]TWP Marketing[/eluser]
I've not used this helper, but did you load it, either in config/autoload.php or in the controller?


dompdf - El Forum - 09-06-2012

[eluser]claudia_ef[/eluser]
I did it but I've got a fatal error. I've already put the to_dompdf_helper.php in config/autoload.php


dompdf - El Forum - 09-06-2012

[eluser]TWP Marketing[/eluser]
Looking at the github wiki: https://github.com/EllisLab/CodeIgniter/wiki/PDF-generation-using-dompdf
this:
Code:
Path where I have dompdf: /application/helpers/dompdf
should be this:
Code:
Path where I should have dompdf: /system/helpers/dompdf



dompdf - El Forum - 09-06-2012

[eluser]claudia_ef[/eluser]
I guess both path are similars. I'd prefer put dompdf files in application/helpers path because system path takes part of the CI core. I'm going to try with github wiki.


dompdf - El Forum - 09-06-2012

[eluser]TWP Marketing[/eluser]
The quickest test is to move dompdf.php into the system/helpers folder, check permissions and run the app. It either works or not.