PHPackages                             screenshotmachine/screenshotmachine-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [PDF &amp; Document Generation](/categories/documents)
4. /
5. screenshotmachine/screenshotmachine-php

ActiveLibrary[PDF &amp; Document Generation](/categories/documents)

screenshotmachine/screenshotmachine-php
=======================================

Captures website screenshot and converts website to PDF using Screenshot machine - online website screenshot generator and website to PDF converter.

2.0.0(6y ago)513.0k↑38.5%4[1 issues](https://github.com/screenshotmachine/screenshotmachine-php/issues)MITPHP

Since Jul 23Pushed 6y ago1 watchersCompare

[ Source](https://github.com/screenshotmachine/screenshotmachine-php)[ Packagist](https://packagist.org/packages/screenshotmachine/screenshotmachine-php)[ Docs](https://github.com/screenshotmachine/screenshotmachine-php)[ RSS](/packages/screenshotmachine-screenshotmachine-php/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependenciesVersions (3)Used By (0)

screenshotmachine-php
=====================

[](#screenshotmachine-php)

Captures website screenshot and converts website to PDF using Screenshot machine - online website screenshot generator and website to PDF converter.

Installation
------------

[](#installation)

a) using Composer - package manager for PHP

```
php composer.phar require screenshotmachine/screenshotmachine-php
```

b) or download source code directly from GitHub.com

First, you need to create a free/premium account at [www.screenshotmachine.com](https://www.screenshotmachine.com) website. After registration, you will see your customer key in your user profile. Also secret phrase is maintained here. Please, use secret phrase always, when your API calls are called from publicly available websites.

Set-up your customer key and secret phrase (if needed) in the script:

```
$customer_key = "PUT_YOUR_CUSTOMER_KEY_HERE";
$secret_phrase = ""; //leave secret phrase empty, if not needed
```

Website screenshot API
----------------------

[](#website-screenshot-api)

Set additional options to fulfill your needs:

```
//mandatory parameter
$options['url'] = "https://www.google.com";

// all next parameters are optional, see our website screenshot API guide for more details
$options['dimension'] = "1366x768";  // or "1366xfull" for full length screenshot
$options['device'] = "desktop";
$options['format'] = "png";
$options['cacheLimit'] = "0";
$options['delay'] = "200";
$options['zoom'] = "100";
```

More info about options can be found in our [Website screenshot API](https://www.screenshotmachine.com/website-screenshot-api.php).

#### Sample code

[](#sample-code)

```
