mercredi 26 juin 2019

Using spatie/browsershot get Class 'App\Http\Controllers\Manipulations' not found error

Using pluhttps://github.com/spatie/browsershot I try to save html content to jpg file and I need to set rendered image in full height(content can be in several pages in pdf file is generated). Is there is way for it, as default generated image is cut by height.

I tried by :

    use Spatie\Browsershot\Browsershot;
    ...
    Browsershot::html( htmlspecialchars_decode($content) )
        ->showBackground()
        ->fit(\Manipulations::FIT_CONTAIN, 200, 200)
        ->save($save_to_file);

and got error :

Class 'App\Http\Controllers\Manipulations' not found

Which declarations did I miss? I did not find have I to add any devlarations into config/app.php ?

composer.json :
    "require": {
        "laravel/framework": "5.8.*",
        "spatie/browsershot": "^3.27",
        "spatie/laravel-image-optimizer": "^1.4",

package.json:
    "dependencies": {
        "puppeteer": "^1.14.0",
        "pusher-js": "^4.3.1"
    }



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2IMnjLp
via IFTTT

Aucun commentaire:

Enregistrer un commentaire