tcpdf error

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 ?

thank you

Found the answer here -> http://www.tek-tips.com/viewthread.cfm?qid=834208

Hi,

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’;”

before constructor:

$pdf = Yii::createComponent(‘application.extensions.tcpdf.ETcPdf’, ‘P’, ‘cm’, ‘A4’, true, ‘UTF-8’);

Best,

aydin

I have error message ‘not a PDF file or corrupted’ when I open pdf file…

how to solve it ?