browsershot | Convert HTML to an image , PDF or string | Document Editor library

 by   spatie PHP Version: 3.57.6 License: MIT

kandi X-RAY | browsershot Summary

kandi X-RAY | browsershot Summary

browsershot is a PHP library typically used in Editor, Document Editor, Nodejs, PhantomJS applications. browsershot has no vulnerabilities, it has a Permissive License and it has medium support. However browsershot has 1 bugs. You can download it from GitHub.

Convert HTML to an image, PDF or string

            kandi-support Support

              browsershot has a medium active ecosystem.
              It has 4307 star(s) with 446 fork(s). There are 65 watchers for this library.
              It had no major release in the last 12 months.
              browsershot has no issues reported. On average issues are closed in 39 days. There are 6 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of browsershot is 3.57.6

            kandi-Quality Quality

              browsershot has 1 bugs (0 blocker, 0 critical, 1 major, 0 minor) and 11 code smells.

            kandi-Security Security

              browsershot has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              browsershot code analysis shows 0 unresolved vulnerabilities.
              There are 1 security hotspots that need review.

            kandi-License License

              browsershot is licensed under the MIT License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              browsershot releases are available to install and integrate.
              Installation instructions, examples and code snippets are available.
              browsershot saves you 261 person hours of effort in developing the same functionality from scratch.
              It has 656 lines of code, 96 functions and 4 files.
              It has high code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi has reviewed browsershot and discovered the below as its top functions. This is intended to give you an instant insight into browsershot implemented functionality, and help decide if they suit your requirements.
            • Get the full command to be executed .
            • Call browser .
            • Save the image to a file .
            • Set a value in an array .
            • Create screenshot command
            • Creates a new Chrome output failure .
            • Thrown when the output file does not contain an extension .
            Get all kandi verified functions for this library.

            browsershot Key Features

            No Key Features are available at this moment for browsershot.

            browsershot Examples and Code Snippets

            No Code Snippets are available at this moment for browsershot.

            Community Discussions


            Browsershot / Puppeteer overloads CPU and times out
            Asked 2022-Jan-27 at 19:01

            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 power while trying to execute the command.

            As far as I can tell, this constant CPU drain will continue until I restart the server. I also only requested for one image to be made in this example, yet there are three processes of chrome. I'm not sure if that's irregular.

            In order to make sure that it wasn't something on my website or possibly a setting causing this, I used a simple function call.



            Answered 2022-Jan-27 at 04:10

            I think I've finally figured it out.

            From Browsershot's Github page, it recommends executing these commands to install puppeteer.



            Simulate a IOS environment for test website in safari
            Asked 2021-Nov-22 at 13:53

            I'm developing an simples website using html, css/bootstrap and JS. I received feedback by Iphone user that some features not working in IOS mobile. Some Images not loading and counter-up not working too. In windows and android is working fine (chrome and Firefox). The question is, how I create a environment for simulate a IOS mobile for check how safari browser load my site? I tried install safari in windows but it not show equals execution in IOS. I think that browsershots not is a good ideia, because it works only with static content, and in the moment return 500 internal server error.



            Answered 2021-Nov-22 at 13:53

            Microsoft BrowserStack provides a full test environment, however beyond the complimentary trial period it is not free. For errors related to pageload or reference, I would suggest you use device emulation and network throttling in a browser: Safari, Firefox, Chrome.

            Some browsers are more forgiving of errors, so you may even have a typo. Is your trustworthy friend using an outdated browser while you require modern feature support? The scope of the problem seems undeserving of a bill for membership or tech support.



            Laravel Sail install puppeteer chromium
            Asked 2021-Apr-21 at 11:50

            I have setup a Laravel Sail environment and I am trying to save a webpage as a pdf using puppeteer.

            I am currently using this package to run puppeteer via laravel -

            There requirements section specifies you need to download puppeteer via npm.

            Laravel Sail has npm setup so I have installed the puppeteer package but when I try and save a webpage as a screenshot I get the following error



            Answered 2021-Apr-21 at 11:50

            You need to install puppeteer with chromium inside the docker container. I've currently the exact same setup for Browsershot with Sail. You'll need to publish the sail config files which will allow you to edit the docker container.



            Docker container called in Laravel
            Asked 2021-Mar-25 at 12:11

            How do I call a docker container within Laravel? I am using the following package to download PDFs, I have an npm container which I am trying to use with this package.

            My site container doesn't have node or npm installed which is why I need to use my npm container instead.

            Here is my docker file



            Answered 2021-Mar-25 at 12:11

            You dont need a seperate Node / NPM Container. The Browsershot is part of your applications core. To make it work you need nodejs and npm. That saying I would construct my own container image incuding PHP and Node. That makes the implementation of Browershot more simple.

            If neede you can split them up later. But in that case I would create a new BrowserShot service (PHP + Node).

            As you can see, there are multiple ways doing it.

            What about using NGINX Unit for your applications container base? You could use the Unit PHP base image and add node on top of it.

            I did that here:




            I got error installing guzzlehttp/guzzle in in laravel 5.8 app
            Asked 2021-Mar-23 at 11:50

            I need to install guzzlehttp/guzzle to work with stripe in laravel 5.8 app but I got

            error with installing :



            Answered 2021-Mar-23 at 11:50

            You have to update the version of your guzzlehttp/guzzle becasue it is required by php version

            Try to Change "guzzlehttp/guzzle": "^5.x" to this "guzzlehttp/guzzle": "^7.2.0" and then run composer update and your current php version is ^7.2

            you can find more about it in here



            With html2pdf in generated pdf as all css styles are lost
            Asked 2020-Jul-18 at 15:40

            In my laravel 5.7 / bootstrap 4.4 app I use spatie/browsershot 3.37 and spipu/html2pdf 5.2 to generate pdf file and for my generated pdf file want I set layout with 100% height and footer and header like here:

            But imported block of code which looks ok on my blade page in browser is invalid in generated pdf : as all css styles are lost.

            by clicking on “To pdf file” content of the page is rendered into pdf file:



            Answered 2020-Jul-06 at 15:32

            It does not work like that in pdf Parser plugin.. give all css inline. forexample no files can be read as direct



            Moving from laravel 5.8 to 7x errors with maddhatter/laravel-fullcalendar
            Asked 2020-Apr-15 at 07:40

            I try to move my laravel 5.8 to 7x branch. I try to move 6 branch firstly. But I got errors with maddhatter/laravel-fullcalendar, as I got error with



            Answered 2020-Apr-15 at 07:40

            the maddhatter/laravel-fullcalendar dependency need the version 5 of illuminate/support.

            So you can't update laravel with this dependency. Moreover, it seems that this project was not updated since 3 years

            But a fork exist here.And it works with laravel for 5,6 and 7



            Call Docker container outside docker
            Asked 2020-Jan-28 at 16:44

            I have a project running under Apache and without docker. However, in this project, I have a PDF export and this PDF export I want to call it in a docker container. How do you do that?

            Here is my docker-compose.yaml :



            Answered 2020-Jan-28 at 15:54

            Try to run commands with bash


            Community Discussions, Code Snippets contain sources that include Stack Exchange Network


            No vulnerabilities reported

            Install browsershot

            This package can be installed through Composer.


            We invest a lot of resources into creating best in class open source packages. You can support us by buying one of our paid products. We highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. You'll find our address on our contact page. We publish all received postcards on our virtual postcard wall.
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
          • HTTPS


          • CLI

            gh repo clone spatie/browsershot

          • sshUrl


          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link