Hi, I’m very new to YII.
I supposed to generate pdf report but I’m getting this error messagebox.
File does not begin with ‘%PDF-’.
Local\EWH)jm8_&y
I need some help, thanks.
Hi, I’m very new to YII.
I supposed to generate pdf report but I’m getting this error messagebox.
File does not begin with ‘%PDF-’.
Local\EWH)jm8_&y
I need some help, thanks.
Hello & welcome.
Your code, please?
Hi Bennouna, this is the script from two files.
xpdf.php file from views/trnSaro
<?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");
?>
TrnSaroController.php
/**
*/
public function actionExportPdf()
{
//$rs = TrnSaro::model()->findAll();
//$this->render(‘export_pdf’, array(‘rs’=>$rs));
$this->render(‘xpdf’);
}
Oh ok sorry so this goes into the extension page. I don’t have experience with this one.
Let’s hope someone —that does— stops by.