Open Iainthealer opened 2 years ago
Fixed it my self. I was using wrong namespace.
Correct one was use Barryvdh\DomPDF\Facade as PDF;
Yes or Barryvdh\DomPDF\Facade\Pdf
After using this i am getting this error. need help. (Call to a member function get_cellmap() on null)
Yes or
Barryvdh\DomPDF\Facade\Pdf
No that dosen't work. the facade class is called Facade not Pdf like this. Barryvdh\DomPDF\Facade it's also wrong in the readme.
None of it is working, please work on it.
It's working fine with the latest version of laravel-dompdf (v1.0.2). Maybe you need to update the package.
// import
use Barryvdh\DomPDF\Facade\Pdf;
// usage
PDF::setPaper('a4', 'portrait')->loadView('your_view', $your_view_data)->save(storage_path('/dir') . '/' . $filename);
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Any issues with PDF rendering itself that are not directly related to this package, should be reported on https://github.com/dompdf/dompdf instead. When having doubts, please try to reproduce the issue with just dompdf. If you believe this is an actual issue with the latest version of laravel-dompdf, please reply to this issue so we can investigate further. Thank you for your contribution! Apologies for any delayed response on our side.
Hello.
I am using latest blank laravel installation on 7.4php as well as package v1.0.0 (beta). When I try to generate .pdf file I always get error: Error Using $this when not in object context
Barryvdh\DomPDF\PDF::loadView vendor/barryvdh/laravel-dompdf/src/PDF.php:142
public function loadView($view, $data = array(), $mergeData = array(), $encoding = null) { $html = $this->view->make($view, $data, $mergeData)->render();
// This is line 142
return $this->loadHTML($html, $encoding); }Thank you!