2

Spatie\Browsershot
Laravel

My Code :

$save_to_file = storage_path('public/cv/file.pdf');

Browsershot::html('<h1>test<h1>')
->noSandbox()
->save($save_to_file);

The Error :

For some reason Chrome did not write a file at `/home/______/public_html/myfiles/storage/public/cv/file.pdf`. 

1 Answers1

0

Maybe try this : how to fix Spatie/Browsershot error somehow Chrome did not write a file at `screenshot.pdf`

This work for me with spatie/browsershot in GitHub Actions CI. Although composer install puppetter, installing manually puppetter and chromium on the system made the generation of PDFs work.

npm install -g puppeteer

npm install -g chromium