segy / Mpdf

CakePHP 2.x Component for creating PDF files from HTML using mPDF class
30 stars 19 forks source link

pdf generating as empty #13

Open rohit-web opened 8 years ago

rohit-web commented 8 years ago

Hi i am using cakephp 2.6 version

i put below code in action -

public function generate_pdf() { $this->Mpdf->init();

    // setting filename of output pdf file
    $this->Mpdf->setFilename('file.pdf');

    // setting output to I, D, F, S
    $this->Mpdf->setOutput('D');

    // you can call any mPDF method via component, for example:
    $this->Mpdf->SetWatermarkText("Draft");

}

generate_pdf.ctp

cart shop
77 Wing Hong Street, Kowloon, Hong Kong Tel +852 5555821

 

INVOICE

Invoice Number:   3487813
Invoice Number:   3487813
Order Number:   3487813
Order Date:   2016-02-15 09:28:21
Invoice To:   stanley leong chin wei  
Invoice Date:   2016-02-15 09:28:21

getting a empty pdf file