Product support

Visit this product's website for support.



To install from the Marketplace, click on the "Add to Project" button and then select the project you wish to add it to before updating the project to pull in the plugin.

To install from the backend, go to Settings -> Updates & Plugins -> Install Plugins and then search for LukeTowers.SnappyPDF.

To install from the repository, clone it into plugins/luketowers/snappypdf and then run composer update from your project root in order to pull in the dependencies.

To install it with Composer, run composer require luketowers/oc-snappypdf-plugin from your project root.


The main configuration values that you may wish to change would be the paths to the executable binaries for wkhtmltopdf and wkhtmltoimage. These binaries are pulled into plugins/luketowers/snappypdf/vendor/bin by default (when installing from the marketplace) and the default configuration reflects this. Also supported by default is installing by cloning the repository and loading the dependencies with composer update (where the binaries will be located in your project's vendor/bin).

If you need to change the path used to locate those binaries, then you have a few options. If you are already using .env files for environment level configuration then you can simply add SNAPPY_PDF_BINARY and SNAPPY_IMAGE_BINARY with their respective paths to your .env file and call it a day.

If you are not using .env files, or you need to change a configuration value other than the binary paths; then you can override this plugin's configuration and change the necessary values by copying config/config.php from the plugin into your project's config/luketowers/snappypdf/config.php file (as specified in the OctoberCMS docs).


When using this plugin, it is highly recommended that you add a dependency on it to the plugin you are using it from.

In order to use the libraries provided by this plugin (SnappyPDF and SnappyImage), simply import them with use statements at the top of your PHP files.

The example below will render a record from a controller and stream it to the browser for downloading or viewing.

<?php namespace MyVendor\MyPlugin\Controllers;

use File;
use Twig;
use Response;
use SnappyPDF;
use Backend\Classes\Controller;

use MyVendor\MyPlugin\Models\Example as ExampleModel;

class Examples extends Controller
    public function download($id)
        // Load the example record
        $example = ExampleModel::find($id);

        // Load the template
        $template = File::get(plugins_path('myvendor/myplugin/views/example-record-template.htm'));

        // Render the template
        $renderedHtml = Twig::parse($template, [
            'example' => $example,

        // Render as a PDF
        $pdf = SnappyPDF::loadHTML($renderedHtml)
            ->setOption('margin-top', 0)
            ->setOption('margin-bottom', 0)
            ->setOption('margin-left', 0)
            ->setOption('margin-right', 0)

        return Response::make($pdf, 200, [
            'Content-Type'        => 'application/pdf',
            'Content-Disposition' => "filename={$example->name}.pdf",

More information on utilizing the libraries is available at the barryvdh/laravel-snappy repository and the wkhtmltopdf manual.

  • Found the plugin useful on 18 Dec, 2018

    Justin Patterson said it once and said it best. Great plugin :)

  • Found the plugin useful on 6 Feb, 2018

    Having used Snappy & wkhtmltopdf for the last few years in their manual capacities, I nearly fell out of my chair when I first saw this plugin avilable. Is it simple? Heck yeah it is. Does it work? That's an affirmative. Is it so much easier than me bringing in everything manually? YES! No bells and whistles, no bloat, no bs... just a fantastic plugin if you need some simple PDF output!

  • author

    Replied on 6 Feb, 2018

    Glad you enjoyed it!


Added windows binaries

Aug 22, 2019


Made available on Packagist

Oct 09, 2017


Fixed the wkhtmltoX binaries not being executable upon first install from the marketplace

May 16, 2017


Fixed one of the alternative locations the wkhtmltopdf binaries could be loaded from

Apr 25, 2017


First version of SnappyPDF

Apr 18, 2017