CakePHP Cakepdf(Plugin) error Missing View 'Create PDF for file storage'

588 Views Asked by At

I am using cakePHP 2.6 and CakePdf plugin. While generating and saving i came across a problem of Missing View

Code Controller

public function testpdf() {
    $CakePdf = new CakePdf();
    $CakePdf->template('newsletter', 'default');
    // write it to file directly
    $pdf = $CakePdf->write(APP . 'files' . DS . 'newsletter.pdf');
}

Error Recived:

Missing View

Error: The view for AdminsController::testpdf() was not found.

Confirm you have created the file: Pdf/newsletter.ctp in one of the following paths:

/var/www/html/cake2pluginsEdited/app/View/Plugin/AdminUsers/Pdf/newsletter.ctp
/var/www/html/cake2pluginsEdited/app/Plugin/AdminUsers/View/Pdf/newsletter.ctp
/var/www/html/cake2pluginsEdited/app/View/Pdf/newsletter.ctp

I have created newsletter.ctp on all the given paths in above error still its providing me the same error. Already given write permission to whole app folder. Also gone through the issues on Git Hub Issues CAkePdf Cannot find a solution, any pointers will be a great help.

The code Render as PDF works fine but cannot get it saved on server.

0

There are 0 best solutions below