Skip to content

Releases: DirectoryTree/Screenshot

v1.2.0

Choose a tag to compare

@stevebauman stevebauman released this 16 Oct 13:38
74371e8

Added

  • A Gotenberg driver for capturing PNG, JPEG, and PDF files through a remote service using the existing fluent API. Thanks @hosmelq! #7
use DirectoryTree\Screenshot\Facades\Screenshot;

Screenshot::driver('gotenberg')
    ->view('invoices.preview', ['invoice' => $invoice])
    ->javascript()
    ->pdf()
    ->save(storage_path('app/invoice.pdf'));

Requires Gotenberg 8.38 or later. The capture's JavaScript setting must match the service. See the Gotenberg documentation for configuration and supported options.

Full Changelog: v1.1.1...v1.2.0

v1.1.1

Choose a tag to compare

@stevebauman stevebauman released this 15 Oct 15:17
fe3613a

Added

  • Protected createBrowserFactory() and getBrowserOptions() methods for customizing Chrome browser creation in custom drivers - #5

v1.1.0

Choose a tag to compare

@stevebauman stevebauman released this 15 Oct 14:11
59ba454

Added

  • Support for custom screenshot drivers through Screenshot::extend() and Screenshot::driver(), with Chrome as the default - #3
  • A shared Contracts\Factory interface for typed injection, with a fake that records captures across all drivers - #3
  • A0, A1, A2, A6, Tabloid, and Ledger PDF paper sizes - #4

Breaking Changes

  • Inject DirectoryTree\Screenshot\Contracts\Factory instead of the concrete Screenshot class when resolving screenshots through Laravel's container.
  • Register custom drivers using Screenshot::extend() instead of replacing the Contracts\Driver binding.
  • Screenshot::fake() now returns ScreenshotManagerFake instead of ScreenshotFake. Existing facade capture and assertion calls continue to work.

v1.0.0

Choose a tag to compare

@stevebauman stevebauman released this 14 Oct 21:02
a006f77

The first stable release of Screenshot brings image and PDF capture to PHP and Laravel using Chrome. Node.js and Puppeteer aren't required.

Capture HTML, Blade views, or URLs, then save the result locally or store it on a Laravel filesystem disk:

use DirectoryTree\Screenshot\Facades\Screenshot;

Screenshot::view('invoices.preview', ['invoice' => $invoice])
    ->element('#invoice')
    ->pdf()
    ->save(storage_path('app/invoice.pdf'));
  • PNG, JPEG, and PDF output with separate image and print settings.
  • Full-page, viewport, and element image capture with configurable size limits.
  • Element PDFs using the document's print styles, paper settings, and page breaks.
  • Shared browsers for parallel workers and a Chrome installer for supported platforms.
  • Capture fakes and assertions for Laravel tests.

Element PDFs move the selected content into the document body. Styles that depend on removed parent elements may need adjustment.

Requires PHP 8.2+. Laravel integration supports Laravel 12 and 13, with PHP 8.3+ required for Laravel 13.

composer require directorytree/screenshot:^1.0
php artisan screenshot:install

See the README for configuration and usage.