I have downloaded the TCPDF extension and put it into the extension folder of my application. When i was running the my application the i got the following error require_once(D:\Dev\Apache\htdocs\first\protected\extensions\tcpdf/tcpdf/tcpdf.php): failed to open stream: No such file or directory.

Please suggest the solution. thnks to all…

Make sure your paths are correct and also use DIRECTORY_SEPARATOR … seems you have an issue there… "\tcpdf/tcpdf/"


Personally, I don’t use any extension. I have downloaded the tcpdf code and put it in extensions/tcpdf folder.

And then, in the code (for example: in a static function of a Yii model), I do :

//Prepare the pdf exporter

$html2pdfPath = Yii::getPathOfAlias('ext.tcpdf');




$pdf = new TCPDF('L', PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);



// set document information




$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, "title", "subtitle");

$pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));

$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));




$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);

$pdf->SetFont('helvetica', '', <img src='' class='bbc_emoticon' alt='8)' />;




//Write the html from a Yii view

$html = Yii::app()->controller->renderPartial('//viewPath/_export'), true,true);

//Convert the Html to a pdf document

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


// reset pointer to the last page


//Close and output PDF document

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

[color="#006400"]/* moved to extensions forum */[/color]

Hi mixeart, why my page return

[color="#FF0000"][b]Error 400

Your request is invalid.[/b][/color]

I’ve a controller with actionView_Pdf() then renderPartial a view_pdf.php file :( what wrong ?

controller code:

public function actionView_Pdf($id)







Please check that you have passed your request with id. Like this, index.php?r=site_id/action_id&id=your value