Download the PHP package assisted-mindfulness/browsershot without Composer

On this page you can find all versions of the php package assisted-mindfulness/browsershot. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package browsershot

Browsershot

Tests

The package can convert a webpage to an image or PDF. The conversion is done behind the screens by Google Chrome. This package has been tested on MacOS and Ubuntu. If you use another OS your mileage may vary. Chrome should be installed on your system.

On a Forge provisioned Ubuntu server you can install the latest stable version of Chrome like this:

Also, if necessary, you need to install additional resources, such as fonts for displaying emoji:

Installation

This package can be installed through Composer.

Usage

In all examples it is assumed that you imported this namespace at the top of your file

Here's the easiest way to create an image of a webpage:

Browsershot will make an educated guess where Google Chrome is located. If Chrome can not be found on your system you can manually set its location:

By default the screenshot will be a png and it's size will match the resolution you use for your desktop. Want another size of screenshot? No problem!

You can also set the size of the output image independently of the size of window. Here's how to resize a screenshot take with a resolution of 1920x1080 and scale that down to something that fits inside 200x200.

You can also capture the webpage at higher pixel densities by passing a device scale factor value of 2 or 3. This mimics how the webpage would be displayed on a retina/xhdpi display.

In fact, you can use all the methods spatie/image provides. Here's an example where we create a greyscale image:

If, for some reason, you want to set the user agent Google Chrome should use when taking the screenshot you can do so:

The default timeout of Browsershot is set to 60 seconds. Of course, you can modify this timeout:

Browsershot will save a pdf if the path passed to the save method has a pdf extension.

Alternatively you can explicitly use the savePdf method:

Browsershot also can get the body of an html page after JavaScript has been executed:

You can also use an arbitrary html input, simply replace the url method with html:

License

The MIT License (MIT). Please see License File for more information.


This is a fork of the spatie/browsershot project which does not require Node and Puppeteer to be installed on your web server.


All versions of browsershot with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
spatie/image Version ^2.2
spatie/phpunit-snapshot-assertions Version ^4.0
spatie/temporary-directory Version ^2.1
symfony/process Version ^6.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package assisted-mindfulness/browsershot contains the following files

Loading the files please wait ....