lundi 29 février 2016

laravel 5 html to pdf view issue

I am trying to put html and save it as pdf. however, it seems the content inside pdf not rendered well. I am using plugin from maatwebsite. Here is the code I've tried

Controller

Excel::create('test',function($file){
        $file->sheet('Sheet1', function ($sheet){

            $sheet->loadView('excel');
            $sheet->setAutoSize(true);
        });

    })->store('pdf',storage_path('uploaded-excel'));

View

<body>
    <p>test</p>
    <img src="images/hierarchy.png"/>
</body>

Result

enter image description here

But when I remove img tag, the size itself looks normal

enter image description here

What am I missing?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire