私はpdf生成のためにcodeigniterで古いバージョンのdompdfを使用していましたが、最近、コアdompdfディレクトリを新しいバージョンのdompdf-0.5.2.zipに変更しました。以下は、dompdfクラスに接続するために使用しているコードです。
class Pdf{
var $_dompdf = NULL;
/**
* Constructor Method
**/
function __construct(){
ini_set("memory_limit", "1G");
require_once("Dompdf/dompdf_config.inc.php");
if(is_null($this->_dompdf)){
$this->_dompdf = new DOMPDF();
}
}
/**
* HTML to PDF Conversion method
**/
function convert_html_to_pdf($_html, $_filename = '', $_stream = false, $_orientation = "portrait"){
$this->_dompdf->set_paper("a4", $_orientation);
$this->_dompdf->load_html($_html);
$this->_dompdf->render();
if($_stream){
$this->_dompdf->stream($_filename);
} else{
file_put_contents($_filename, $this->_dompdf->output());
}
}
}
pdfを生成しようとすると、次のエラーが発生します。致命的なエラー:クラス'DOMPDF'が21行目のD:\ xampp \ htdocs \ app \ application \ libraries\Pdf.phpに見つかりません
任意の解決策をいただければ幸いです
ありがとう