adalah fungsi dari cezpdf yang digunakan untuk menambahkan gambar ke pdf.
sintax nya :
$this->cezpdf->
ezImage($image,[$pad=5],[$width=0],[$resize='full'],[$just='center'],[$border='']);
atau
$this->cezpdf->
ezImage($image);
karena [] optional.
contoh:
function createpdf($orientation = 'portrait') {
$this->load->library('cezpdf');
$this->cezpdf->ezImage( 'http://localhost/WHS/images/report.png', $pad = 5,$width =0,$just = 'center'');
$this->cezpdf->ezStream();
}
Jalankan fungsi tersebut dan lihat hasilnya...
kemungkinan error yg terjadi:
A PHP Error was encountered
Severity: NoticeMessage: Undefined variable: cont
Filename: libraries/cezpdf.php
Line Number: 1447
atau
A PHP Error was encountered
Severity: NoticeMessage: Undefined variable: offset
Filename: libraries/cezpdf.php
Line Number: 1518
Atasi error tersebut dengan memperbaiki fungsi ezImage.
caranya: buka file cezpdf.php yang berada pada folder library
kemudian tambahkan variable cont dan offset pada fungsi ezImage seperti kode dibawah ini;
function ezImage($image, $pad = 5, $width = 0, $resize = 'full', $just = 'center', $border = '') {
//beta ezimage function
$cont='';
$offset='';
Sekarang lihat hasilnya....
semoga tulisan ini dapat bermanfaat.....