2017 © Pedro Peláez
 

library pdf

Sun PDF is the pdf generating tools for the serious PHP developers.

image

sun/pdf

Sun PDF is the pdf generating tools for the serious PHP developers.

  • Tuesday, January 19, 2016
  • by IftekherSunny
  • Repository
  • 7 Watchers
  • 19 Stars
  • 286 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 12 Forks
  • 0 Open issues
  • 2 Versions
  • 3 % Grown

The README.md

Sun PDF

Total Downloads Latest Stable Version Latest Unstable Version License, (*1)

Sun PDF is the pdf generating tools for the serious PHP developers., (*2)

Installation Process

Just copy PDF folder somewhere into your project directory. Then include Sun PDF autoload file., (*3)

require_once('/path/to/PDF/autoload.php');

Sun PDF is also available via Composer/Packagist., (*4)

composer require sun/pdf

Basic Uses

Downloading PDF

$pdf = new Sun\PDF;
$pdf->download("<h1>Hello world</h1>");

Viewing PDF In The Browser

$pdf = new Sun\PDF;
$pdf->stream("<h1>Hello world</h1>");

Getting PDF Output

$pdf = new Sun\PDF;
$pdf->output("<h1>Hello world</h1>");

Changing Configuration

In the Sun PDF I used PhantomJS. You can change all the configuration of the PhantomJS. To change PhantomJS configuration, you need to pass your own configuration file into Sun PDF constructor., (*5)

$pdf = new Sun\PDF("/path/to/SunPdf.js");

Please, click This Link to know about all the configuration of the PhantomJS., (*6)

If you do not wish to pass HTML codes as plain string, you can pass your HTML/PHP file into all the method of the Sun PDF. To use default template engine features you need to setup everything before use. All you have to do for setup is -, (*7)

$pdf = new Sun\PDF(null, "/path/to/views");

I used Twig template engine, click This Link to know about Twig template engine., (*8)

Generating PDF With Template Engine

$pdf = new Sun\PDF(null, "/path/to/views");

// download pdf 
$pdf->download("/path/to/views/test.php", ['name' => 'Iftekher Sunny']);

// viewing pdf in the browser
$pdf->stream("/path/to/views/test.php", ['name' => 'Iftekher Sunny']);

Integration In Laravel Framework

Add the ServiceProvider to the providers array in config/app.php, (*9)

Sun\Provider\PDFServiceProvider::class,

Add the facade to the aliases array in config/app.php, (*10)

'PDF'   =>  Sun\Facade\PDFFacade::class,

Integration In Planet Framework

Add the provider in the config/provider.php file., (*11)

Sun\Provider\PDFProvider::class,

Add the alien in the config/alien.php file., (*12)

'PDF'   =>  Sun\Alien\PDFAlien::class,

License

This package is licensed under the MIT License, (*13)

The Versions

19/01 2016

dev-master

9999999-dev

Sun PDF is the pdf generating tools for the serious PHP developers.

  Sources   Download

MIT

The Requires

 

twig php pdf fpdf html to pdf dompdf sun planet

19/12 2015

v1.0

1.0.0.0

Sun PDF is the pdf generating tools for the serious PHP developers.

  Sources   Download

MIT

The Requires

 

twig php pdf fpdf html to pdf dompdf sun planet