gimana cara make tcpdf

akang akang tau cara make tcpdf ga di yii framwork?

kebetulan udah diekstrak ke protected/extension tapi

mau usage nya kebingungan

<?php

$pdf = Yii::createComponent(‘application.extensions.tcpdf.ETcPdf’,

                        'P', 'cm', 'A4', true, 'UTF-8');

$pdf->SetCreator(PDF_CREATOR);

$pdf->SetAuthor("Nicola Asuni");

$pdf->SetTitle("TCPDF Example 002");

$pdf->SetSubject("TCPDF Tutorial");

$pdf->SetKeywords("TCPDF, PDF, example, test, guide");

$pdf->setPrintHeader(false);

$pdf->setPrintFooter(false);

$pdf->AliasNbPages();

$pdf->AddPage();

$pdf->SetFont("times", "BI", 20);

$pdf->Cell(0,10,“Example 002”,1,1,‘C’);

$pdf->Output("example_002.pdf", "I");

dipake dmana gt maaf newbie nih hehe

berhubung Yii menggunakan konsep MVC, maka agan taruh di controller. untuk view-nya kasih tombol yg akses ke controller tersebut.

Saya tambahi Setelah addpage:




$pdf->AddPage();


$model = NamaModel::model()->findAll();

$html = $this->renderpartial('_nama_report_view', array('model' => $model),true);

$pdf->writeHTML($html, true, false, true, false);

$pdf->Output('report.pdf', 'I');



Merdeka