After following this guide, see reference:
http://www.yiiframework.com/extension/tcpdf/
I got an error messagebox that says:
file does not begin with ‘%PDF-’
I followed the code written in there.
Any help please.
Thanks.
After following this guide, see reference:
http://www.yiiframework.com/extension/tcpdf/
I got an error messagebox that says:
file does not begin with ‘%PDF-’
I followed the code written in there.
Any help please.
Thanks.
The solution is to use blank layout, which only contains
<?php echo $content; ?>
This prevents any appending html tags to the generated pdf.
Cheers!
Hi, I am new in yii.
I want to create pdf in yii. I created but it shows blank.
Please, Solve my problem.
my code:
Yii::import(‘application.extensions.*’);
require_once('tcpdf/tcpdf.php');
require_once('tcpdf/examples/lang/eng.php');
$pdf = new TCPDF();
$pdf->SetCreator(PDF_CREATOR);
$pdf->SetAuthor('Nicola Asuni');
$pdf->SetTitle('TCPDF Example 001');
$pdf->SetSubject('TCPDF Tutorial');
$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
$pdf->SetHeaderData('', 0, PDF_HEADER_TITLE, '');
$pdf->setHeaderFont(Array('helvetica', '', <img src='http://www.yiiframework.com/forum/public/style_emoticons/default/cool.gif' class='bbc_emoticon' alt='8)' />);
$pdf->setFooterFont(Array('helvetica', '', 6));
$pdf->SetMargins(15, 18, 15);
$pdf->SetHeaderMargin(5);
$pdf->SetFooterMargin(10);
$pdf->SetAutoPageBreak(TRUE, 0);
$pdf->SetFont('dejavusans', '', 7);
$pdf->AddPage();
$pdf->writeHTML("<span>Hello World!</span>", true, false, true, false, '');
$pdf->LastPage();
$pdf->Output("example_002.pdf", "I");
Thank You