Fuel package for snappy library.
PHP
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
classes
config
.gitmodules
bootstrap.php
readme.md

readme.md

Fuel Snappy

Fuel snappy is a wrapper package for the awesome snappy library.

Snappy

Snappy is a PHP5 library allowing thumbnail, snapshot or PDF generation from a url or a html page.
It uses the excellent webkit-based wkhtmltopdf and wkhtmltoimage available on OSX, linux, windows.

You will have to download wkhtmltopdf 0.10.0 >= rc2 in order to use Snappy.

Usage

Copy the config file from package's config folder to your app's config folder. Add the path to the wkthtmltopdf binary.

<?php

$pdf = Pdf::forge();
header('Content-Type: application/pdf');
header('Content-Disposition: attachment; filename="file.pdf"');
echo $pdf->getOutput('http://www.fuelphp.com');

Credits

Snappy has been originally developed by the KnpLabs team.