Yii Framework Forum: gimana cara make tcpdf - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

gimana cara make tcpdf tcpdf Rate Topic: -----

#1 User is offline   sidik 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 2
  • Joined: 23-July 12

Posted 24 July 2012 - 12:39 AM

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
0

#2 User is offline   siskalandre 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 92
  • Joined: 16-March 11
  • Location:Indonesia

Posted 31 July 2012 - 09:33 PM

View Postsidik, on 24 July 2012 - 12:39 AM, said:

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.
0

#3 User is offline   mbahsomo 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 40
  • Joined: 29-March 10

Posted 10 August 2012 - 01:21 AM

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
Sugik Puja Kusuma [mbahsomo]
http://sugik.do-event.com
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users