verumconsilium / laravel-browsershot

Browsershot wrapper for Laravel 5
MIT License
111 stars 20 forks source link

Chained methods being ignored #8

Closed jrmypttrsn closed 5 years ago

jrmypttrsn commented 5 years ago

My current return statement:

return PDF::loadView('pdfs.cert2', array('certificate' => $certificate))->inline($file_name);

works just fine. But chaining any methods from spatie's library before ->inline() seem to be ignored. Chaining them after results in method does not exist errors.

Any idea what I may be doing wrong?

sgtpepper9907 commented 5 years ago

What method are you trying to chain? And what error is it throwing ?

jrmypttrsn commented 5 years ago

At the moment, ->landscape() is ignored (the pdf remains portrait) and if I put it after ->inline() then I get Method Illuminate\Http\Response::landscape does not exist, which I would expect to happen.

sgtpepper9907 commented 5 years ago

I just tested it on a Laravel 5.7 fresh installation and landscape() is working as expected. Is there any way I can replicate this issue?

sgtpepper9907 commented 5 years ago

I will close this issue since there was no reply and the method seems to be working fine. Feel free to reopen it if you have more info on how to replicate the issue

bencarrr commented 5 years ago

I'm getting the same thing with both download and landscape

 PDF::loadView($view)->landscape()->download()
PaulRotter commented 4 years ago

The landscape() seemingly being ignored may be due to included bootstrap css. This may force page size to portrait. Set $enable-print-styles scss variable to false or specify page size: a4 landscape.