indigophp/fuel-pdf

This package is abandoned and no longer maintained. No replacement package was suggested.

Fuel PDF package for dfferent PDF libraries

dev-master 2014-01-15 11:22 UTC

This package is not auto-updated.

Last update: 2022-02-01 12:28:23 UTC


README

Fuel wrapper for Indigo PDF

Install

Via Composer

{
    "require": {
        "indigophp/fuel-pdf": "dev-master"
    }
}

Configuration

return array(
    'instances' => array(
        'default' => function () {
            $options = array(
                'orientation' => 'P',
            );

            $config = array(
                'a_meta_charset'  => 'UTF-8',
                'a_meta_dir'      => 'ltr',
                'a_meta_language' => 'en',
                'w_page'          => 'page',
            );

            return new Indigo\Pdf\Adapter\TcpdfAdapter($options, $config);
        },
        'advanced' => function () {
            $options = array(
                'orientation' => 'P',
            );

            $config = array(
                'bin' => '/usr/bin/wkhtmltopdf',
                'tmp' => sys_get_temp_dir(),
            );

            return new Indigo\Pdf\Adapter\WkhtmltopdfAdapter($options, $config);
        }
    ),
    'default' => 'default',
);

Usage

$pdf = \Pdf::forge('default');

// Later in your code
$pdf = \Pdf::instance('default');

Advanced usage

$options = array(
    'orientation' => 'P',
);

$config = array(
    'bin' => '/usr/bin/wkhtmltopdf',
    'tmp' => sys_get_temp_dir(),
);

$instance = Indigo\Pdf\Adapter\Wkhtmltopdf($options, $default);

$pdf = \Pdf::forge('non_existent', $instance);

// Later in your code
$pdf = \Pdf::instance('non_existent');

Credits

License

The MIT License (MIT). Please see License File for more information.