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
1
vote
0 answers

Browsershot TimeoutError: Navigation timeout of 30000 ms exceeded Laravel 8

I want to generate pdf using puppeteer in laravel 8. It is generating pdf, if i set timeout, but shows error instead to redirecting to generated pdf. And if i don't set timeout, then pdf does not generate and showing the error. Below is my code…
Isha
  • 99
  • 1
  • 9
1
vote
1 answer

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

I am trying to create a pdf file using browsershot but getting error. I installed Browsershot on my cpanel hosting Here is my code
1
vote
1 answer

Browsershot : show two pages per sheet

I'm using the spatie/browsershot package with puppeteer to generate pdf in my applications. I have several templates for the generation, so I created a blade template for every template made. I'm having a problem with one of the templates though,…
Liwine
  • 11
  • 2
1
vote
0 answers

How to convert html to pdf and store on storage in laravel?

I am using BrowserShot to convert HTML to PDF. When I saved pdf file on storage disk I am facing following problem. The command "PATH=$PATH:/usr/local/bin NODE_PATH=`npm root -g` node…
Irshad Khan
  • 161
  • 2
  • 15
1
vote
1 answer

unable to generate PDF from spatie bowsershot

i have installed browsershot in my laravel project I have installed puppeteer, installed chromium , my npm version is updated, but still i am unable to get the PDF of my simple html input , i have tried to take screenshot by URL method and save as…
1
vote
0 answers

how to resolve an error to use spatie laravel

I am using spatie library in laravel lumen to create file into image. But it is giving error. $destinationPath = storage_path('uploads'); $new_path = str_replace('\\', '/', $destinationPath); Browsershot::url('https://www.example.com/') …
Vinod
  • 123
  • 1
  • 3
  • 14
1
vote
1 answer

Spatie Browsershot and letterhead / CSS

I'm trying to generate PDF with content of a view in Laravel application using spatie/browsershot & laravel-browsershot wrapper; I am using svg as my letterhead background and would like to place content of the view in within certain area of the SVG…
dascorp
  • 183
  • 7
  • 15
1
vote
1 answer

Puppeteer takes blurry screenshots of SVG

I'm using puppeteer via browsershot to take a screenshot of an D3 SVG graph. While the graph looks perfectly fine when previewed on the local URL, once I screenshot it with puppeteer it doesn't look as sharp as before. Manually taken screenshot…
spekulatius
  • 1,434
  • 14
  • 24
1
vote
2 answers

Problem with the installation of Spatie on Windows

I'm trying to configure Spatie/Browsershot for a project, written in Laravel but after completing all of the steps, I still get one error: 'node' is not recognized as an internal or external command, operable program or batch file A have installed…
H.Karatsanov
  • 199
  • 4
  • 16
1
vote
0 answers

Puppeteer create pdf with browsershot - error with headerHtml and footerHtml

When I try to create a headerHtml or footerHtml on windows 10 with some class or style inside I got an error For example : All is working if I don't put any style or class : ->footerHtml('
hello footer
') And if I put an…
Florian Richard
  • 80
  • 1
  • 10
1
vote
0 answers

Spatie Browsershot not working on Linux server. Getting error sh: node: command not found

I'm using Browsershot on a laravel project. When I use in on localhost it works perfectly. However, no matter what I do, I can't seem to get it to work on the live server. I'm running it on a Linux VPS. Here is my code (within a controller): use…
Avi
  • 728
  • 3
  • 10
  • 20
0
votes
2 answers

How do I center-top the header and center-bottom the footer on every printed page while having @page margins?

I'm using spatie/browsershot to generate pdf documents in a laravel project. It has built in headerHtml and footerHtml methods but it is buggy with images, first it only accepts base64/svg and some images with transparent background are getting…
lance2k
  • 357
  • 1
  • 4
  • 14
0
votes
1 answer

How do I resize an image without it getting cropped while maintaining aspect ratio in browsershot headerHtml?

I used browsershot to generate A4 pdf documents in our Laravel project. On my browsershot headerHtml, I need to display one image logo which should automatically resize to fit a div container while maintaining its aspect ratio. Following this…
lance2k
  • 357
  • 1
  • 4
  • 14
0
votes
1 answer

Browsershot stopped working after reinstalling npm and node with node version manager

I reinstalled node and npm with nvm after facing EACCES permissions errors when installing npm-check-updates globally. Resolving EACCES permissions errors when installing packages globally This fixed my npm-check-updates installation. But when I…
lance2k
  • 357
  • 1
  • 4
  • 14
0
votes
0 answers

Why is Browsershot generating the pdf screenshot of the login page instead of the dashboard page?

my task is to generate a pdf screenshot of a certain page. We're using Laravel for the BE (running on http://127.0.0.1:8000) and Angular on the FE (running on http://localhost:4200). While trying to run the code below public function…
lance2k
  • 357
  • 1
  • 4
  • 14