Questions tagged [browsershot]

Browsershot is a 3rd party Laravel package developed by Spatie to capture webpage screenshots using Google's Puppeteer and Chrome

The browsershot package can convert a webpage to an image or pdf. The conversion is done behind the scenes by Puppeteer which controls a headless version of Google Chrome.

https://github.com/spatie/browsershot

47 questions
4
votes
0 answers

Browsershot not taking snapshot of chartjs

I'm trying to take screenshot of chartjs library which has an interval set via browsershot and it wouldn't execute javascript code. This is my code. All I'm getting is a blank image. var canvas = …
Ali Rasheed
  • 2,765
  • 2
  • 18
  • 31
3
votes
1 answer

Laravel - Spatie/Browsershot not working on a Docker Environnment

I would like to use the Spatie/Browsershot library on my Laravel10 project but can't quite figure out how to make it work on a Docker environnement. Error Output (Spatie\Browsershot\Exceptions\CouldNotTakeBrowsershot) For some reason Chrome did not…
3
votes
0 answers

Problem with taking a screenshot of a URL with browsershot

I've tested browsershot locally (Windows 10 Pro, XAMPP, nodejs v14.17.6), but I've faced a problem that I can't solve. I'm getting the following error: The command "C:/node/nodejs/node.exe…
3
votes
1 answer

Issue with running Puppeteer and Browsershot in Laravel Vapor Docker runtime

I am trying to run Puppeteer and Spatie/Browsershot in Laravel Vapor Docker Runtime but getting following error type: 'error', message: 'socket hang up', error: Error: socket hang up at connResetException (internal/errors.js:639:14) at…
3
votes
0 answers

Laravel Spatie Browsershot errno: -4058, code: 'ENOENT'

I am trying to capture a screenshot of my website running in localhost and i am using Spatie/Browsershot. When i try to run this function public function receipt(){ $image = Browsershot::url('http://localhost:8000/transaction/receipt/123') …
3
votes
3 answers

Browsershot won't save or write my pdf -> For some reason Chrome did not write

Looking for brilliant mind to help me fix my problem. I have inherited a Laravel v5.3 project, and the project should be able to pass CV's from html to .pdf. They have been using spatie/browsershot for that task. But for some reason the package…
Teambit
  • 185
  • 2
  • 9
2
votes
0 answers

Unable to get Laravel Browsershot working with Puppeteer Ubuntu 20.04 Arm PHP 8.2 with Snap Chromium & Nginx

I spent quite a bit of time trying to get Laravel 9 Browsershot working on a job queue server on an Arm Ubuntu 20.04 on AWS EC2 running PHP 8.2. I was finally able to get it to work and am documenting here in case it helps anyone else googeling…
Justin Vincent
  • 1,329
  • 2
  • 14
  • 22
2
votes
1 answer

Browsershot / Puppeteer overloads CPU and times out

I have been using Browsershot to retrieve some images from my website without any issues for months, but recently (past 1-2 weeks), the request has been timing out. Looking further into it, I've found that it has been consuming a large amount of cpu…
Seth
  • 51
  • 1
  • 7
2
votes
1 answer

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

Spatie\Browsershot Laravel My Code : $save_to_file = storage_path('public/cv/file.pdf'); Browsershot::html('

test

') ->noSandbox() ->save($save_to_file); The Error : For some reason Chrome did not write a file at…

user13091150
2
votes
1 answer

Problem generating PDF using Laravel Spatie/Browsershot

I 'm trying to generate a PDF using the below code: $content = view('bills.show', ['bill' => $bill])->render(); return Browsershot::html($content)->setNodeBinary('C:/PROGRA~1/nodejs/node.exe')->pdf(); however i am getting this error (attaching full…
alexfar
  • 121
  • 9
2
votes
1 answer

Why in pdf file generated with spatie/browsershot no header and last line of any page is cut off?

In Laravel 8 app I make pdf file with browsershot and it mostly works ok for me, except case my data contains several pages, I have 2 problems : I do not see header which I define with footer (code below) : https://i.stack.imgur.com/nujuf.jpg I…
mstdmstd
  • 2,195
  • 17
  • 63
  • 140
2
votes
1 answer

HTML to PDF: Elements overlapping fixed footer

I would like to render HTML to PDF. To get this working, I make use of Browsershot, which uses a headless Chrome to render the HTML and CSS. This is my additional style to fit A4-format:
SPQRInc
  • 162
  • 4
  • 23
  • 64
2
votes
1 answer

Local fonts not loaded correctly?

I am using Browsershot, which is based on Puppeteer to create PDF from HTML. The HTML-source is rendered Laravel-Blade. This is my blade-template that is being rendered:
SPQRInc
  • 162
  • 4
  • 23
  • 64
1
vote
0 answers

spatie / browsershot: What's causing 127 error generating PDF with Laravel?

This should be pretty straightforward, but I can't get it to work. This is on Mac OS 12.6x, MacBook M1. $html = view('auth.reports.pdf', $data)->render(); return Browsershot::html($html)->save('test.pdf'); But it's giving me this error. If it's…
buckthorn
  • 1,727
  • 13
  • 15
1
vote
2 answers

Brosershot PDF not loading external images and styles when run on a queue

Problem I have an issue with generating PDFs via Browsershot on a queue. The PDFs do not load any images or stylesheets for some reason however, when generating the same PDF via a browser request the images and stylesheets are loaded as expected. I…
thursday_dan
  • 553
  • 6
  • 17
1
2 3 4