I am trying out on the tcpdf extension - http://www.yiiframework.com/extension/tcpdf.
It works fine when i view it from linux, but always gives me error from windows, it says:“file does not begin with ‘%PDF-’”.
Anyone got any ideas for this problem ?
The error is because of html layout (headers and footers) of page. We need to disable layout of page before creating pdf file.
So, add the following:
“$this->layout = ‘pdf’;”
$pdf = Yii::createComponent(‘application.extensions.tcpdf.ETcPdf’, ‘P’, ‘cm’, ‘A4’, true, ‘UTF-8’);
I have error message ‘not a PDF file or corrupted’ when I open pdf file…
how to solve it ?