jeudi 30 juin 2016

Multiple pdf creation using vsmoraes/laravel-pdf

I am using vsmoraes/laravel-pdf for pdf creation. For single pdf creation it works fine. But when I am trying to create multiple pdf it shows the error No block-level parent found. Not good. This is what i am doing in my controller code to generate pdf. Need help, thanks.

  <?php namespace App\Http\Controllers;

    use Vsmoraes\Pdf\Pdf;

    class HomeController extends BaseControler
    {


  private $pdf;

    public function __construct(Pdf $pdf)
    {
        $this->pdf = $pdf;
    }

    public function helloWorld()
    {
        $html = view('pdfs.example1')->render();
        for($i=0; $i<3;$i++){
        return $this->pdf
            ->load($html)
            ->show();
             }
        }
    }



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire