websnap/php

Websnap PHP Client

1.4.0 2021-07-26 05:46 UTC

This package is auto-updated.

Last update: 2021-07-26 05:49:06 UTC


README

Install with composer: composer require websnap/php

Getting started

  1. Register for free at https://www.websnap.app
  2. Create a project and copy it's token

Usage

You can either pass an url to a website or a string containing html to the client. The client will return a \Psr\Http\Message\ResponseInterface object containing the generated pdf/screenshot.

Generate an image

$client = new \Websnap\Php\Client('YOUR_TOKEN');

// Take screenshot of an url
$response = $client->screenshot('https://www.websnap.app');

// Take screenshot of passed html
$response = $client->screenshot('<h1>Hello world!</h1>');

Generate a pdf

$client = new \Websnap\Php\Client('YOUR_TOKEN');

// Capture content as PDF
$response = $client->pdf('https://www.websnap.app');

// Generate pdf of passed html
$response = $client->pdf('<h1>Hello world!</h1>');

Please see the documentation for further options.

Contact

Did you found a bug or need a certain feature? Please get in touch with us or raise an issue.