Skip to content
This repository has been archived by the owner on Nov 24, 2021. It is now read-only.

indigophp-archive/fuel-pdf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

57 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fuel PDF package

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.

About

Fuel wrapper for PHP PDF generator libraries

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages